Update and rename array-move-zeros-inplace.py to move_zeros_inplace.py

This commit is contained in:
marina 2023-08-07 17:26:30 -07:00 committed by GitHub
parent 86a538032a
commit 2f1db3f84e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,10 +20,7 @@ Output: [0]
def move_zeroes(nums: list[int]) -> list[int]:
"""
Do not return anything, modify nums in-place instead.
"""
i = 0
while i < len(nums) - 1:
@ -39,9 +36,3 @@ def move_zeroes(nums: list[int]) -> list[int]:
return nums
if __name__ == "__main__":
nums = [0,1,0,3,12]
assert(move_zeroes(nums) == [1,3,12,0,0])