Expand description
Advent of Code 2022 Day 4: https://adventofcode.com/2022/day/4
I would describe my solutions to the day four challenges as the brute force solutions, there are probably much better, cleverer, and more efficient solutions.
In both parts we start by converting the string representations into their numeric counterparts so that we can operate on them as numbers and/or ranges.
The first part is relatively simple, we just do a comparison if the first range is contained in the second or vice versa. In the second part We loop through all of the numbers in the first range and check if any of the numbers are contained in the second range.
Functions§
- The solution for the day four challenge.