This is my code
class Solution: # @param a list of integers # @return an integer def removeDuplicates(self, A): A = [A[i] for i in range(len(A)) if A[i] != A[i-1] or i == 0] return len(A)
Leetcode gives it a test case as :input = [1,1,2]
On my PC this code correctly output [1,2]
But leetcode says the output is [1,1].