Autodesk Interview Question

Leetcode Hard, a minmax optimisation problem.