http://codingbat.com/prob/p259809