Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 362 Bytes

027._Remove_Element.md

File metadata and controls

25 lines (18 loc) · 362 Bytes

27. Remove Element

题目: https://leetcode.com/problems/remove-element/

难度: Easy

瞬秒

class Solution(object):
    def removeElement(self, nums, val):
        """
        :type nums: List[int]
        :type val: int
        :rtype: int
        """
        while val in nums:
            nums.remove(val)
        return len(nums)