53. Maximum Subarray Sum / Kadane
Problem Statement
Given an integer array nums
, find the
subarray with the largest sum, and return its sum.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 105
-104 <= nums[i] <= 104
Intuition
Links
Video Links
Approach 1:
Approach 2:
Approach 3:
Approach 4:
Similar Problems
Last updated