[PYTHON 2.7] returns nothing for test case [ 0 ]; even when it should return 0

i start iterating from i=1; so if A=[0]; it should not enter the loop at all; and it should go directly to the return statement and return 0. instead there’s something weird going on;

for A = [0] length is still 1. So instead of 0 you should return 1.

Make your code return 1 for A[0] and it will be correct. InterviewBit’s output thats shown is wrong .

Click here to start solving coding interview questions