http://codingbat.com/prob/p178353