Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Instructions: Write an algorithm that takes an array and moves ALL OF THE ZEROS to the END, PRESERVING the order of the other ELEMENTS.
    Log arr: [ 9, 0, 0, 9, 1, 2, 0, 1, 0, 1, 0, 3, 0, 1, 9, 0, 0, 0, 0, 9 ]

    expected '[9,9,9,9,1,2,1,1,3,1,0,0,0,0,0,0,0,0,0,0]' to equal '[9,9,1,2,1,1,3,1,9,9,0,0,0,0,0,0,0,0,0,0]'

    Where in the instructions it says that 9 needs to be moved to the beginning, fix it