0 out of 464 challenges solved
Write a Python function `move_zeroes_to_end(lst)` that takes a list of integers as input and moves all the zeroes in the list to the end while maintaining the order of the non-zero elements. #### Example Usage ```python [main.nopy] move_zeroes_to_end([1, 0, 2, 0, 3, 4]) # Output: [1, 2, 3, 4, 0, 0] move_zeroes_to_end([0, 1, 0, 1, 1]) # Output: [1, 1, 1, 0, 0] move_zeroes_to_end([0, 0, 0]) # Output: [0, 0, 0] ```
def move_zeroes_to_end(lst): """ Moves all zeroes in the list to the end while maintaining the order of non-zero elements. Args: lst (list): A list of integers. Returns: list: A new list with zeroes moved to the end. """ # Placeholder for the solution pass