bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Medium1-D Dynamic ProgrammingLC 152

Maximum Product Subarray

Given an integer array nums, find a subarray that has the largest product, and return the product. The test cases are generated so that the answer will fit in a 32-bit integer.

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