Solution to problem 29

LINQ makes this trivial.