IT_World

[leetcode] 27. Remove Element 본문

Coding test/programmers - single

[leetcode] 27. Remove Element

engine 2022. 3. 21. 17:04

 

 

class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        lennum = len(nums)
        while val in nums :
            nums.remove(val)
        return len(nums)
Comments