Here’s my solution for day 12. Main highlights:
- Takes about 2.2 seconds in total to solve both parts. Then just 0.03 seconds on a subsequent run, due to tabling.
- Tabling requires the lists to be ground, so I used
u
instead of leaving list elements var - Neat example of using a DCG for file import