Skip to content

Commit bd6b26f

Browse files
committed
Sync LeetCode submission - Remove Element (python3)
1 parent adda11f commit bd6b26f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

problems/remove_element/solution.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def removeElement(self, nums: List[int], val: int) -> int:
3+
index = 0
4+
5+
for i in range(len(nums)):
6+
if nums[i] != val:
7+
nums[index]= nums[i]
8+
index = index + 1
9+
10+
return index

0 commit comments

Comments
 (0)