http://codingbat.com/prob/p216901