Search⌘ K
AI Features

Solution: Maximum Product Subarray

Solution: Maximum Product Subarray gives an integer array, possibly containing negative values, and asks for the largest product obtainable from any contiguous subarray.

Statement

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

Constraints:

  • 1≤1\leq ...