Exercises/#119 Move Zeros to End
#119

Move Zeros to End

EasyπŸ“¦ Arrays
35 XP

Problem

Given an array, move all zeros to the end while maintaining the relative order of non-zero elements. Do it in-place.

Examples

Input: nums = [0, 1, 0, 3, 12]
Output: [1, 3, 12, 0, 0]
arraytwo-pointerin-place
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

119 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features