Pipes are a common pattern in functional programming. It mainly boils down to having some kind of input, which is provided to a chain of methods which successively take the input, process it and ...
You already know the recursive function. So, it would be easier. Also, let’s talk a little bit about the range selector (also known as slicing). For example, you want to select a range of elements.