adventofcode

Happy Advent 2020! Please put answers in the pinned threads or create one if it does not exist yet. | https://github.com/adventofcode-clojurians/adventofcode-clojurians | Join the private leaderboard with code 217019-4a55b8eb
AC 2021-01-24T03:11:53.004600Z

I don’t have an answer for why your code ran slow, but I used the clojure reader to handle parsing day 18 --

(defn parse-expr
  [s]
  (read-string (str "(" s ")")))

> (parse-expr "((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2")
(((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2)