http://codingbat.com/prob/p291371