Neat Python

  • 0
    class Solution(object):
        def removeDuplicates(self, nums):
            :type nums: List[int]
            :rtype: int
            if nums == []: return 0
            curP = 0
            for i in xrange(len(nums)):
                if nums[i] > nums[curP]:
                    nums[curP] = nums[i]
            return curP+1

Log in to reply

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