Skip to content

Commit

Permalink
Create removeElement.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaudeNi authored Oct 4, 2022
1 parent f09a025 commit 5401263
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions leetcode/python/removeElement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Solution(object):
def removeElement(self, nums, val):
"""
:type nums: List[int]
:type val: int
:rtype: int
"""
count = 0
for i in nums:
if i != val:
nums[count] = i
count = count + 1
return count

0 comments on commit 5401263

Please sign in to comment.