Final implementation of the partition problem.