Added solution for #17 in Ruby.