Created
October 10, 2016 20:37
-
-
Save jhigdon/700868a6dd5cd736f47a85bd046aee41 to your computer and use it in GitHub Desktop.
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
thing l = map (\x -> if (count x lower) > 1 then ')' else '(' ) lower | |
where lower = map toLower l | |
count n = length . filter (==n) | |
-- λ: thing "SucCess" == ")())())" | |
-- True | |
-- λ: thing "din" == "(((" | |
-- True | |
-- λ: thing "recede" == "()()()" | |
-- True | |
-- λ: thing "SucCess" == ")())())" | |
-- True | |
-- λ: thing "(( @" == "))((" | |
-- True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment