Solution to problem 24.

Was nice to use some extension methods in this solution, great feeling
of DRY principle and keeps the code concise/easy to read.