Explanation:
• Use insertPos to track where the next non-zero element should go.
• Iterate through the array, copying non-zero elements to the front.
• After all non-zero elements are moved, fill the rest of the array with zeros.
This approach keeps the relative order of non-zero elements and runs in O(n) time with O(1) extra space.