Ad
  • Custom User Avatar

    As I understand the rules, this test:
    Testing for [0, 0, 0, 3, 0, 4, 2, 0]

    should produce result:
    [0, 0, 3, 4, 2, 0]
    because arr[1] should collapsing with arr[0],
    arr[4] -> arr[2]
    and arr[7] stay at his place

    But expected result was: [0,3,4,2,0]

    How is that?