class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
if len(nums)==0:
return 0
slow=0
for fast in range(1,len(nums)):
if nums[fast]>nums[slow]:
slow+=1
nums[slow]=nums[fast]
return slow+1
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
fast=0
slow=0
for fast in range(0,len(nums)):
if nums[fast]!=val:
nums[slow]=nums[fast]
slow+=1
return slow