mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-22 08:21:12 -04:00
Update and rename array-move-zeros-inplace.py to move_zeros_inplace.py
This commit is contained in:
parent
86a538032a
commit
2f1db3f84e
1 changed files with 1 additions and 10 deletions
|
@ -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])
|
Loading…
Add table
Add a link
Reference in a new issue