From 283f805ef24a974e61a6548f1974ba7a3770522c Mon Sep 17 00:00:00 2001 From: s50600822 Date: Sun, 26 Nov 2023 03:20:16 +1100 Subject: [PATCH] https://leetcode.com/problems/maximum-product-subarray impl --- .../maximum_product_subarray/Solution.java | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/interview_prep/algorithm/java/ide_handicapped/maximum_product_subarray/Solution.java b/interview_prep/algorithm/java/ide_handicapped/maximum_product_subarray/Solution.java index 69f3ede..aa42f13 100644 --- a/interview_prep/algorithm/java/ide_handicapped/maximum_product_subarray/Solution.java +++ b/interview_prep/algorithm/java/ide_handicapped/maximum_product_subarray/Solution.java @@ -4,12 +4,35 @@ class Solution { public int maxProduct(int[] n) { - return 99999; + int answer = n[0]; //just to start + int min = 1, max = 1; + + for(int i=0; i