CodeOath
← All problems

Move Zeroes

Easy
arraystwo-pointers

Move all 0s to the end while keeping the relative order of the non-zero elements.

Example:

Input: nums = [0,1,0,3,12]
Output: [1,3,12,0,0]