Solution to the find min problem.