mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-23 00:41:19 -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,9 +20,6 @@ Output: [0]
|
||||||
|
|
||||||
|
|
||||||
def move_zeroes(nums: list[int]) -> list[int]:
|
def move_zeroes(nums: list[int]) -> list[int]:
|
||||||
"""
|
|
||||||
Do not return anything, modify nums in-place instead.
|
|
||||||
"""
|
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
|
@ -39,9 +36,3 @@ def move_zeroes(nums: list[int]) -> list[int]:
|
||||||
|
|
||||||
|
|
||||||
return nums
|
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