See: https://adventofcode.com/2015/day/1 ** Part 1 *** Purpose Given a stream of parenthesis: #+begin_example ))((((( #+end_example We subtract the number of "((" parens from the number of ")))". *** Method The solution to this is simple: count the number of each, and perform the subtraction. Given that I already solved part on of this problem before, I will instead immediately design a solution to the problem that also works for part 2. In my attempt months ago, I made the "mistake" of not using a loop :): ** Part 2 *** Purpose Now, we need to calculate the index of the input stream where the cumulative number is first zero. *** Method The above information reveals that a solution that would work for both parts is a simple loop structure.