Different outputs


#1

For Test Case 21 0 7 6 3 6 1 4 2 9 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
Test With Custom Input gives 0
Test gives 1


#2

Same case happened with. Can someone help