Move zeros to end

The only challenge here to optimize the space complexity.

Minor difference from above: