Maximum Subarray Score with Indices

Given an integer array nums. The score of a contiguous subarray nums[L..R] with length at least 2 is nums[L] + nums[R] - (sum of middle elements).

Return the left and right indices [L, R] (0-...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: