Adding solution to problem #2.

It's a pretty cool solution.