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/BlackwaterPark_1980 Dec 01 '15

I used Seq.sumBy.

let getFloor = 
  Seq.sumBy (function 
    | '(' -> 1
    | ')' -> -1
    | _ -> failwith "Whoops"
  )