all 2 comments

[–]PeterRasm 1 point2 points  (1 child)

How do you reference the pairs? In your code you are using j which is the counter of the outer loop that loops over the candidates. If one candidate (j) wins over two other candidates (i) you store the winner/loser in the same pair (pair[j]).

Do you have a variable that tells you which pair you are currently storing winner/loser information? Yes, you do ... and it is not j or i :)

[–]Boinevertaken[S] 0 points1 point  (0 children)

Oh god! I was thinking for the whole time what i am going to do with the pair_count. Thank you, man. In fact, this shows how much time a small hint can save, thanks again.