bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Medium1-D Dynamic ProgrammingLC 53

Maximum Subarray

Given an integer array nums, find the subarray with the largest sum, and return its sum.

Asked at 36 companies
AdobeAlibabaAmazon
Hints
  • 1.Think about what data structure fits Maximum Subarray
  • 2.Consider the brute force complexity and how to optimize
  • 3.Can you trade space for time?
LeetCodeNeetCode