Open fockspaces opened 1 year ago
GPT improve
class Solution:
def moveZeroes(self, nums: List[int]) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
pt = 0
for i in range(len(nums)):
if nums[i] != 0:
nums[pt], nums[i] = nums[i], nums[pt]
pt += 1