<filename>Array/Leetcode 27. Remove Element.py
class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        idx = 0
        for num in nums:
            if num != val:
                nums[idx] = num
                idx +=1
        return idx 
<filename>Array/Leetcode 27. Remove Element.py
class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        idx = 0
        for num in nums:
            if num != val:
                nums[idx] = num
                idx +=1
        return idx 