Chapter1 coding interview till problem 5.