Ruby: problem 1

Made it into a one-liner.