← All problemsSign in

Naruto hates meetings

Naruto was forced to attend a very useless meeting so he invented a useless game (still more productive than the meeting) to pass the time. Naruto is given an array $A$ which contains $N$ numbers $A_1,A_2,...,A_N$ where $A_i$ represents the $i^{th}$ number. He has to move all $0$ present in the array to the end while maintaining the relative ordering of the non-zero elements. Naruto is not s

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start