Problems > Zeros to the Back > Editorial

Zeros to the Back — Solution & Editorial

Back to the Problem

Copy the non-zero elements forward in order, then fill the tail with zeros.

Complexity: O(N)