I'm not a math person. My question sounds vague so an example is probably better.
I have a large list of arrays. Here's 3:
2: [[64, 126, 188, 251, 313, 375, 437, 499, 562, 625, 695, 757, 824, 897, 961, 967]]
3: [[64, 66, 127, 189, 251, 314, 376, 438, 500, 564, 626, 686, 696, 758, 821, 825, 891, 897, 957, 967]]
4: [[64, 66, 126, 190, 253, 313, 377, 439, 501, 564, 627, 697, 759, 826, 899, 968]]
Index 2 and 3 have duplicates of 64, 251, 897, 967 Index 2 and 4 have duplicates of 64, 126, 313 Index 3 and 4 have duplicates of 64, 66, 564 Index 2,3,4 has 64
If there's more index associated then let's give it a score of 10. Then compare the number of values within the index. 2, 3, 4 only has 64, but index 2 and 3 has 4 values, so let's give that a 9. So the more index number the better, then sort by the number of value by index.
What is the best way to go through each array without looping? Looking at thousands of array.