Problem 3745 · Easy

Maximize Expression of Three Elements

Choose indices i < j < k to maximize nums[i] + nums[j] - nums[k], using the best prefix before each middle index and the best suffix after it.

Open the interactive visualisation