L44 Minimum Subarray
Given an array of integers, find the subarray with smallest sum.
Return the sum of the subarray.
Notice
The subarray should contain one integer at least.
Example
For[1, -1, -2, 1]
, return-3
.
every element multiply -1
then find max subarray sum
then sum * -1
Last updated