The solution to the algorithm problem