http://codingbat.com/prob/p109537