2048 is a game where you need to slide numbered tiles (natural powers of 2) up, down, left or right on a square grid to combine them in a tile with the number 2048.
The sliding procedure is described by the following rules:
Sliding is done almost the same for each direction and for each row/column of the grid, so your task is to implement only the left slide for a single row.
left_slide([2, 2, 2, 0]) ➞ [4, 2, 0, 0]
# Merge left-most tiles first.
left_slide([2, 2, 4, 4, 8, 8]) ➞ [4, 8, 16, 0, 0, 0]
# Only merge once.
left_slide([0, 2, 0, 2, 4]) ➞ [4, 4, 0, 0, 0]
left_slide([0, 2, 2, 8, 8, 8]) ➞ [4, 16, 8, 0, 0, 0]