Problem 3040 · Medium

Maximum Number of Operations With the Same Score II

Remove two numbers from the front, the back or one of each end, keeping every removal at the same score; memoize the intervals that remain.

Open the interactive visualisation