Test case passing for wrong output A : [ 1, 5, 4, 1, 2 ] & B : 0


#1

If i give this input
A : [ 1, 5, 4, 1, 2 ]
B : 0
Then the correct ans should be 1.
But its output is coming to be 0 & is passed also when i submitted.

Can anyone tell me, why is it so?


#2

Note that the array should be sorted.


#3

That’s right…Try this question on LeetCode for better test cases.