Once a water balloon pops, is soaks the area around it. The ground gets drier the further away you travel from the balloon.
The effect of a water balloon popping can be modeled using a list. Create a function that takes a list which takes the pre-pop state and returns the state after the balloon is popped. The pre-pop state will contain at most a single balloon, whose size is represented by the only non-zero element.
pop([0, 0, 0, 0, 4, 0, 0, 0, 0]) ➞ [0, 1, 2, 3, 4, 3, 2, 1, 0]
pop([0, 0, 0, 3, 0, 0, 0]) ➞ [0, 1, 2, 3, 2, 1, 0]
pop([0, 0, 2, 0, 0]) ➞ [0, 1, 2, 1, 0]
pop([0]) ➞ [0]