Skip to content

Instantly share code, notes, and snippets.

@sritchie
Created July 15, 2011 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sritchie/1085641 to your computer and use it in GitHub Desktop.
Save sritchie/1085641 to your computer and use it in GitHub Desktop.
(defn max-4-matches [s]
(loop [check s, matches 0]
(if (or (= 4 matches) (empty? check))
matches
(recur (rest check)
(if (#{\o \x} (first check))
(inc matches)
matches)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment