Let say I have 9 boxes. Each box may randomly contain number 1-9.. Each box minimum contain no number, maximum contain 9 number and each box won't have duplicated number.
My problem is how do I look for pairs/triple/quadruple of same number in different box.
Eg.
Box 1 : 1,2,5,6,7
Box 2 : 5,6,7
Box 3 : <EMPTY>
Box 4 : 3,4,5,6,7,8,9
... <assume box 5-8 all EMPTY>
Box 9 : 1,2
So there wont be 1 pair and 1 triple number : 1,2 and 5,6,7
My current way is using string to do, which I normally used in doing with c++.
I store all the numbers into sBoxNum[9].
Then from the string I find number 1 exists in which box, then store into sNumLocation[9]
Then I used 5-6 nested loop to find out the pairs / triple / quadruple....
I almost can get it but is like complicated and take too long.
I know function of list.Contain, list.Count but is like not helping.
So is there any hints to have better approach?