On 12/04/2015 04:26 PM, wobbles wrote:
r.retro.take(n).retro seems like the easiest fit.

Doesn't work. Try it!

The right solution is to send a scout range ahead. Once the scout got n steps ahead the initial range, advance both until the scout reaches the end. Then return the initial range.

It's a nontrivial algorithm that can't be composed easily from existing ones.


Andrei

Reply via email to