Solve it yourself first, then compare our solutions for curiosity!
Advent of Code is copyright whatever poor soul put together AdventOfCode.com. All instructions and input are theirs, though modified slightly to fit the format.
Code is written by yours truly, Navarr Barnier, and I guess technically belongs to him - though you can't really copyright Math so whatever.
I license this bucket of probably useless code under MIT. Do what you want with it.