Last active
December 6, 2022 17:40
-
-
Save robhanlon22/cc4aabf3ddf73940611d50804dfd06bb to your computer and use it in GitHub Desktop.
aoc2022_day6.clj
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
(defn check | |
[n coll] | |
(loop [i 0 | |
v coll] | |
(let [x (take n v)] | |
(cond | |
(< (count x) n) | |
nil | |
(= (count (set x)) n) | |
(+ i n) | |
:else | |
(recur (inc i) (rest v)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment