class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
while val in nums:
nums.remove(val)
Day 2 of 10. Leet code problem can be found here
I looped through the entire array while checking if the val is in the array. if it is found, i remove that particular value.
tada :)
Top comments (0)