Search⌘ K
AI Features

Solution: Maximum Product Subarray

Solution: Maximum Product Subarray asks you to choose a contiguous subarray of integers and return its largest possible product, even when values may be negative or zero.

Statement

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

Constraints:

  • 1≤1\leq ...