There's a array:
array(1,2,3,...12,
1,2,3,...9,9,10,...12,
1,2,3,...12,
1,2,3,...12,
1,2,3,...6,6,7,8,...12,
1,2,3,3,4,...12,
...);
All numbers are in the range 1-12, one number maybe occur twice in the range,
The index of second number of the twice number will be such as array ( 22 => 9, 56 => 6, 66 => 3, ...);
If we get a number 16 we know the corresponding number is 4,
If we get a number 65 we know the corresponding number is 3,
How to do this in general?
The index is the when the duplicate number occur, 22 => 9 is the duplicate 9 is No. 22 ,1,2,3,...12,
1,2,3,...9,9 12+9 = 21 ,at NO.22 is the duplicate 9