Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;Write a function that returns the first non-repetitive
- ;;character in a string.
- (defn first-duplicate-char [str-in]
- (loop [[h & t] str-in seen #{}]
- (cond
- (nil? h) nil
- (seen h) h
- :else (recur t (conj seen h)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement