mirror of
https://github.com/20kaushik02/leetcode-gulag.git
synced 2025-12-06 07:04:06 +00:00
8 lines
165 B
Python
8 lines
165 B
Python
def removeElement(self, nums: list[int], val: int) -> int:
|
|
i = 0
|
|
for x in nums:
|
|
if x != val:
|
|
nums[i] = x
|
|
i += 1
|
|
return i
|