For the lulz, I turned your code into one line with lambdas: https://gist.github.com/betaveros/1e76b3ca53001c8edcef
It takes quite a few more characters, but it was fun.
It takes quite a few more characters, but it was fun.
Instead of minimizing it to least amount of lines/chars, you have to maximize the clarity of the code such that the rest of us laymen can understand it.
GO!!!!