http://codingbat.com/prob/p232807