Here's a Python solution for the Smoke Test (SPOILER!): https://github.com/edoannunziata/protohackers/blob/master/00...
[0] https://protohackers.com/leaderboard/0