Official algorithmic problem description and constraints.
Alice and Bob have an array of A of N elements, and will play a game on it
That is, Alice must choose some subarray, delete it, and insert the absolute value of its sum in its place.
Bob will do the same, but insert just the sum (and not its absolute value).
Alice wants to maximize the value of the final element, while Bob wants to minimize it.
If both Alice and Bob make their moves optimally, what will the value of the final element be?
Detailed video explanations, mathematical intuition, and clean C++ implementation code.