Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def moveZeroes(self, nums: List[int]) -> None:
- l=r=0
- n=len(nums)
- while r<n:
- if nums[r]:
- nums[l],nums[r]=nums[r],nums[l]
- r+=1
- l+=1
- else:
- r+=1
- return nums
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement