subarray (1) 썸네일형 리스트형 Leetcode: Maximum product subarray Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: Input: [2,3,-2,4] Output: 6 Explanation: [2,3] has the largest product 6. Example 2: Input: [-2,0,-1] Output: 0 Explanation: The result cannot be 2, because [-2,-1] is not a subarray. element의 곱이 최대가 되는 subarray를 찾는 문제이다. subarray 문제는 i번째 원소에 대해서 살펴.. 이전 1 다음