Maximum Subarray
Given an integer array nums, find the subarray with the largest sum and return its sum. The subarray must contain at least one element. This is the classic application of Kadane's algorithm and a fundamental DP pattern.
Given an integer array nums, find the subarray with the largest sum and return its sum. The subarray must contain at least one element. This is the classic application of Kadane's algorithm and a fundamental DP pattern.