What's wrong with my solution?(python)

  • 0
     class Solution:
        # @param a list of integers
        # @return an integer
        def removeDuplicates(self, A):
            lst = []
            if not A:
                return 0
            for item in A:
                if item not in lst:
            return len(lst)

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.