Source: Knot Hash
Part 1: Starting with a list of the numbers from
1tonand a list oflengths(as input):
- Initialize
current_positionandskip_sizeto0- For each
lengthelement in thelengthslist:- Reverse the first
lengthelements of the list (starting atcurrent_position)- Move forward by
lengthplusskip_size- Increment
skip_sizeby 1
After applying the above algorithm, what is the product of the first two elements in the list (from the original first position, not the
current_position)?