<jupyter_start><jupyter_text>Title : Maximum Product SubarrayChapter : Dynamic ProgrammingLink : [YouTube](https://youtu.be/RY5f8ESnXLc)ChapterLink : [PlayList](https://youtube.com/playlist?list=PLDV-cCQnUlIa0owhTLK-VT994Qh6XTy4v)문제: 주어진 Array에서 최대곱from typing import List  Maximum Subarray를 계산하여라<jupyter_code>from typing import List 

def maxProduct(nums: List[int]) -> int:
  max_dp = [nums[0]]
  min_dp = [nums[0]]
  
  for idx in range(1,len(nums)):
    prev_idx = idx - 1
    
    num = nums[idx]
    cand0 = num
    cand1 = max_dp[prev_idx] * num
    cand2 = min_dp[prev_idx] * num
    
    max_val = max(cand0,cand1,cand2)
    min_val = min(cand0,cand1,cand2)
    
    max_dp.append(max_val)
    min_dp.append(min_val)
  
  max_product = max(max_dp)
  return max_product

print(maxProduct(nums=[3,-2,1,0,-8,-9]))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12823529411764706, 'fraction_numerical': 0.03176470588235294, 'mean_word_length': 4.253086419753086, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '320497', 'license': 'MIT', 'n_tokens_mistral': 383, 'n_tokens_neox': 385, 'n_words': 56, 'path': 'dynamicProgramming/maxProductSub.ipynb', 'repo_name': 'NoCodeProgram/CodingTest', 'size': '850'}