leetle

Daily challenge for 2025-08-27

239. Maximum Product Subarray

Write a function solve that finds the contiguous subarray within an array (containing at least one number) which has the largest product. If the array is empty, return 0.

Example:
Input: nums = [2,3,-2,4]
Output: 6

Run this challenge interactively in Python or JavaScript when the app loads.