Problem Description

Given an array, move all zeros to the end, but keep the order of non-zero items same. Print the updated array.

Input Format

One line: n then n integers.

Output Format

One line: updated array.

Sample Test Case

Input:
7 0 1 0 3 12 0 5
Output:
1 3 12 5 0 0 0

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next