• + 0 comments

    the problem specification is poorly written: only consider pairs for 1 -n and numbers greater than that: ex 1,2 ; 1,3; 1,4 2,3; 2,4 3,4; 4&4 is 4, so if you consider the number to itself it will always be k-1; if you use loops, one loop goes from 1 to n-1, the other from (index +1) to n.