algorithm · Level 2 · 20 min
Given an integer array nums, find the subarray with the largest sum and return that sum.
nums
- `1 <= nums.length <= 10^5` - `-10^4 <= nums[i] <= 10^4`
Return the maximum subarray sum.
Ask clarifying questions, discuss tradeoffs, and get feedback.
Simulate an engineering interview.
The AI will ask questions about your approach, tradeoffs, and design.