Why is 0,1,2,6 not an answer for given example?


#1

Why is 0,1,2,6 not an answer for given example ?
3+8 = 4+7


#2

Because you need to return tuples as A1 B1 C1 D1 and not A1 D1 B1 C1


#3

Then why 0 6 1 2 is not he ans.

A[A1] + A[B1] = A[C1] + A[D1]
  A1 < B1, C1 < D1
  A1 < C1, B1 != D1, B1 != C1 

all criteria it satisfies.
A1=0
B1=6
C1=1
D1=2


#4

Yes, this is also a valid answer. But we need to return lexicographically smaller answer when there are multiple answers. it is stated in the problem.