03: Mull It Over
Part 1
I’m really pleased with this. Doing the parse() |> eval()
is super super dangerous and should never be done, but it works so I’m happy. I got 343 on the leaderboard which is my best ever.
Part 2
I didn’t realize the example input changed which messed me up a bit. Then I just had to get my regex right and I was good to go. I’m also pleased with my little if...else if
chain. I got an error when x
was a mul()
call, but then realized that I didn’t have to explicitly check because I was already checking for do()
and don't()
and if it’s not either of those, then it must be a mul()
. Oh, and 502 on the leaderboard for part 2 would’ve been a best ever if not for part 1!