Ad
  • Custom User Avatar

    In the first case, the pairs of indices are 0,4 and 1,5, summing to 10.

    In the second case, the pairs are 0,2 and 1,3, summing to 6.

    In both cases, use both 1s once ( "element .. can only be counted in one Pair" ), and use the 0s at indices 0 and 1 ( "return the smallest [ correct answer ]" ).

    I have no idea how you would arrive at 15; it might have helped if you had explained that.