Simple problems to figure out (answers in Ruby)