Skip to content

Instantly share code, notes, and snippets.

@lumie1337
Created June 26, 2020 21:01
Show Gist options
  • Save lumie1337/8dd3d21432f5eb4f60b377b615b9b3d1 to your computer and use it in GitHub Desktop.
Save lumie1337/8dd3d21432f5eb4f60b377b615b9b3d1 to your computer and use it in GitHub Desktop.
(ns Solution
(:gen-class))
(defn -main [& args]
(let [keys {\^ [0 1]
\> [1 0]
\v [0 -1]
\< [-1 0]}
f (fn [position key]
(map + (keys key) position))]
(->> (read-line)
(reductions f [0 0])
frequencies
(map second)
(apply max)
(print))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment