I'm trying to use SQL to solve these, but I'm sure I will run out of runway with SQL and end up having to use some other programming language.
To execute the SQL scripts, move into the ./src/
directory and run with something like this:
sqlite3 < 2.sql
which should output:
part_1
------
13446
part_2
------
13509
As I add other programming languages, I will add instructions on how to run, or maybe add a makefile at the top level to handle it all for you.