Mix of languages, sometimes with multiple implementations.
First implementation in Golang.
First implementation in Golang. Went back and did it again in C using mmap
because I'd never used it before. Fun times!
Python. Nothing too special, except I got a kick out of extending list
to make a row that wraps to avoid arithmetic.
Python again. I just used regex to validate all the fields because none of the validations looked too complicated. They all fit under 80 chars!
Python again. I just replaced F
and L
with 0
s, B
and R
with 1
s and mathed on that. Part 2 gets it's own file and just prints out all of the unoccupied seats and lets me use my human-ness to pick the right answer.
First in Python fairly succinctly. Then in Elixir because I wanted to do at least one in a functional-ish language.
Prolog. Get rekt. Only done the first part. Second part is gonna have to use another datastructure generated by the parser that maps edges to bag counts. Then I get to descend the tree and stack up a bunch of multiplication. Fun times!