Explanation for testcase A : [ 1, 2, 2, 3, 4 ], B : 0


#1

I am quite confused for testcase
A : [ 1, 2, 2, 3, 4 ]
B : 0
it’s answer clearly should be 0 but it says should be 1 someone please explain how?


#2

The first and second occurrence of 2 have different index so ans will be 1 ans is says
i != j