#3788
Maximum Score of a Split
specialist · 860 · lc medium +31 · 51.5% accepted · 70 likes · top 41%
Description
Given an integer array nums of length n, choose a split index i (where 0 <= i < n-1) that maximizes the score prefixSum(i) - suffixMin(i), where prefixSum(i) is the sum of nums[0..i] and suffixMin(i) is the minimum of nums[i+1..n-1], and return this maximum score.
Code
1
2
3