r/programming • • Dec 01 '15

Daily programming puzzles at Advent of Code

http://adventofcode.com/
320 Upvotes

179 comments sorted by

View all comments

Show parent comment

1

u/LJacksoDev Dec 11 '15

Haskell solution!

> findFloor				:: Int -> [Char] -> Int
> findFloor n []		= n
> findFloor n (c:cs) 	| ( c == '(' )		= findFloor (n+1) cs
>						| ( c == ')' )		= findFloor (n-1) cs
>						| otherwise 		= 999