MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/3uyl7s/daily_programming_puzzles_at_advent_of_code/cxj8ffx/?context=3
r/programming • u/Aneurysm9 • Dec 01 '15
179 comments sorted by
View all comments
Show parent comment
2
To be fair, there is no need of a Monoid, a simple call to sum is enough:
findFloor :: String -> Int findFloor = sum . fmap toInt where toInt c = case c of '(' -> 1 ')' -> -1 _ -> 0
View all comments
Show parent comment
2
u/VincentJP Dec 01 '15
To be fair, there is no need of a Monoid, a simple call to sum is enough: