Quant Memo
Coding/●●●●●

Push zero-quantity fills to the end

A fill array contains some zero-quantity placeholders. Move every zero to the end while keeping the non-zero quantities in their original relative order. Do it in place.

qtys = [0, 3, 0, 5, 2]
-> [3, 5, 2, 0, 0]

Rearrange in place so all non-zeros keep order and zeros trail. Aim for O(n)O(n) time, O(1)O(1) space.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions