728x90
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
while val in nums:
nums.remove(val)
728x90
'Leetcode' 카테고리의 다른 글
[LeetCode] Search Insert Position (index) (0) | 2021.03.30 |
---|---|
[LeetCode] Implement strStr() 파이썬 (exhaustive search, find, index string) (0) | 2021.03.29 |
[LeetCode] Merge Two Sorted Lists 파이썬 (linked list) (0) | 2021.03.29 |
[LeetCode] Valid Parentheses 파이썬 (stack, empty stack) (0) | 2021.03.28 |
[LeetCode] Longest Common Prefix 파이썬 (zip, list comprehension, set) (0) | 2021.03.28 |
댓글