We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent adda11f commit bd6b26fCopy full SHA for bd6b26f
problems/remove_element/solution.py
@@ -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