solve problem 15 efficiently