Testing of code is wrong in Python


#1

The code works perfectly outside the ide.
Ide expects to return len of A. If you return value len(A) test is passed. after you submit, same code return empty values.

pls check test code.

My code,

        i = len(A)-1
        if i < 2:
            print '0 '
        count = 0
        while i > 0:
            if A[i] == A[i-1]:
                count += 1
                if count >= 2:
                    A.pop(i)
            else:
                count = 0
            i -= 1
        
        #print ' '.join(str(a) for a in A) + ' '
        #return len(A)