Solution 2: Zero Left
Given an integer array, move all elements equal to 0 to the left side while maintaining the order of other elements in the array. Return an array.
def zero_left(array)
new_array = []
for num in array
if num == 0
new_array.unshift(num)
else
new_array.push(num)
end
end
new_array
end