I have a nx3 sized array. I need to find all rows that have 2 common elements. I can do this using logical operators and comparing each element in turn, but this seems very inefficient.
Is there a better solution?
For example
In the following array, I need to identify that rows 1 and 3 contain 2 matching elements (as do rows 2 and 4).
[5 6 2, 3 2 7, 4 6 5, 9 7 2, 5 3 8]
Best Answer