Načítava sa úloha…
Lists sometimes contain "empty-looking" values that you want to move out of the way without losing the order of important data. The function move_zeroes receives a list nums and moves all zeroes to the end. Keep all non-zero numbers in their original relative order and return a new list.
[0, 1, 0, 3, 12][1, 3, 12, 0, 0][0, 0, 1][1, 0, 0][1, 2, 3][1, 2, 3]def move_zeroes(nums: list[int]) -> list[int]:
Prihláste sa, aby ste videli históriu odoslaní
Prihlásiť saPrihláste sa, aby ste mohli používať AI mentora
Prihlásiť sa[0,1,0,3,12][1,3,12,0,0][0,0,1][1,0,0][1,2,3][1,2,3][0,0,0][0,0,0][][][12,3,0,1,0][12,3,1,0,0]