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 [list-Rem (seq str-in) set-Seen (set [])]
- (print (type list-Rem) " " list-Rem (next list-Rem) "\n")
- (if (= 0 (count str-in))
- nil
- (if (some #(= (first list-Rem) %) set-Seen)
- (first list-Rem)
- (recur
- (seq (next list-Rem))
- (conj set-Seen (first list-Rem)))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement