Checker is buggy

def removeDuplicates(self, A):
    current = None
    output = 0
    for i in range(len(A)):
        if A[i] != current:
            current = A[i]
            output += 1
    return output

Prints 4 but returns an array!


+1, I am getting right answer when running the same input as custom input, but it fails on submitting.


The output is actually the length till which the judge will check your array. Eg. if your return is 4, the judge will check your array till index=3. So you have rearrange the array accordingly.