Last active
June 9, 2022 09:14
-
-
Save dzzzchhh/44ff78245e8656ef39e3679ea0cb4935 to your computer and use it in GitHub Desktop.
The most naive way of solving this problem by a person who is super new to Closure, but I did get joy from solving this nonetheless :)
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 first-reccurring-character | |
([string-sequence] (first-reccurring-character string-sequence #{})) | |
([string-sequence lookup] | |
(let [current-character (first string-sequence)] | |
(if (contains? lookup current-character) | |
current-character | |
(recur (rest string-sequence) (conj lookup current-character)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment