Advent of Code – Day 10
Part 1: The code is pretty simple if we go ahead with using recursion. I started with an iterative solution but quickly realised I am dealing with a list of numbers, going through the numbers one at a time. This is the prerequisite of solving a recursive problem.
The Recursive Solution: The condition is that the input string will have at least one number, otherwise it won’t make any sense. Though we are not dealing with erroneous input here.