Move zeros to end (stable)

Java Medium 10 views
Back to Questions

Problem Description

Task: move all zeros to the end while keeping the relative order of non-zero elements.

Input Format

Java method

Output Format

In-place update

Constraints

Do it in O(n) time.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next