Chapter2 coding interview problem 5.