Maximum Product Subarray

Try to solve the Maximum Product Subarray problem.


Given an integer array, nums, find a subarray that has the largest product, and return the product.


  • 11\leqnums.length 103\leq 10^3

  • 10-10\leqnums[i] 10\leq 10

  • The product of any prefix or suffix of nums is guaranteed to fit in a 32bit32-bit integer.


Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy