I have no idea how to approach this problem and needed some guidance. Any help would be appreciated.
Say I have a matrix/array similar to Table_1. How can I go about finding the first 5 numbers that repeat at least twice only on the FIRST column? Once found a new matrix would be generated where all values from the original matrix would be included up until the 5th value from the FIRST column that repeats at least twice is found similar to Table_2. I have no idea if this is even possible to do. Keep in mind this is just an example, matrix could be larger or smaller so I would prefer not to set a value.
Please refer to images. Thank you.
I would like to keep them as array/matrix and not use cells.