replacing 0's with the nearest non 0 to the right of list
Does anyone have any good ideas on how to go about taking a list of integers / decimals and replacing the 0 elements with the nearest non-zero element to the right of list (note that the last number in list can never be a 0)?
Example:
input list = 2 0.3 0 0 4.1 2 4 0 1 3 0 1
output = 2 0.3 4.1 4.1 4.1 2 4 1 1 3 1
The input list is always dynamic and the list length will change with every iteration.
first find the positions where the 0´s are:

now you can use those numbers to 1. split the lists at each 0 in order to send the right part though a [minimum] to find the smallest greater number to the right, and 2.) replace the 0s with them, for example using zl nth.