Problem 2 finish in ruby