Finished the array distance maximizing problem.