Added algorithm to solve problem 10