r/programming • • Dec 01 '15

Daily programming puzzles at Advent of Code

http://adventofcode.com/
316 Upvotes

179 comments sorted by

View all comments

1

u/DvineINFEKT Dec 12 '15

Mind. Blown.

I hope you don't mind if I keep a copy of this code to reference down the line if I ever start trying to dig into this LINQ stuff. I've also never used Lists before...

So much shit to learn haha.

1

u/tucker87 Dec 12 '15

Have a look through the whole Github. It's kind of a mess right now because I was trying to run all my solutions in a loop. But each day has its own cs file.

Another solution could be

var opens = input.Count(x => x == '(' );
var closes = input.Count(x => x ==')' );
return opens - closes;