Created
June 26, 2020 21:01
-
-
Save lumie1337/8dd3d21432f5eb4f60b377b615b9b3d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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