You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
*/
class Solution {
public:
int maxProduct(vector<int>& nums) {
int min_product = nums[0], max_product = nums[0], final_product = nums[0];