Think in Patterns #3 — In-place Compaction
You are given an array nums. Move every 0 to the end, keep the order of everything else, and do it in place. [0, 1, 0, 3, 12] → [1, 3, 12, 0, 0].
The lazy fix is to delete each zero and append it.
Wa
bswebdev.hashnode.dev5 min read