Skip to content

Latest commit

 

History

History

15-moving-zeros-to-the-end

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Moving zeros to the end

Purpose

Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.

Example

moveZeros([false,1,0,1,2,0,1,3,"a"]) //[false,1,1,2,1,3,"a",0,0]

Decision