===== ISTEM =====
Solve the following programming task.

TASK: Move Zeroes to the End

Write a function 'move_zeroes(nums)' that moves all 0s in an integer list to the end while preserving the relative order of the non-zero elements, updating the same list in place.

STARTER CODE (python):
def move_zeroes(nums: list[int]) -> list[int]:
    # Write your code here
    pass


RULES:
- Keep the function name and signature EXACTLY as given.
- Return working code only. No explanations.
- Put the code in a single ``` block.
- Try to solve it first. If you genuinely cannot, write only this single
  line instead of producing faulty code: CANNOT_SOLVE

===== HAM YANIT =====
```python
def move_zeroes(nums: list[int]) -> list[int]:
    insert_pos = 0
    for i in range(len(nums)):
        if nums[i] != 0:
            nums[insert_pos], nums[i] = nums[i], nums[insert_pos]
            insert_pos += 1
    return nums
```