If i understand the picture correctly it's just about 3->5, 6->2... and not 3->5->6->2->5...! So no number is allowed as "starting point" more than once... But that sounds too easy... Look what i mean: Working example: 3 5 6 2 5 2 1 5 4 2 7 2 This would be 6 pairs: (3->5, 6->2, 5->2, 1->5, 4->2, 7->2) Non-Working example: 1 2 5 6 2 3 6 3 4 5 2 4 4 6 This would be 7 pairs: (1->2, 5->6, 2->3, 6->3, 4->5, 2->4, 4->6) So on the red and on the orange position we have the errors, because the same number is used twice. So you would only need to check if a number is on the first spot more than once... If missed something here - please don't blame me... It's been a really long working day for me - just ignore me then... BTW: What kind of game could that be? MattHouston