Ruby solution for euler06.