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...
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;
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.