Algorithm/LeetCode
LeetCode 42. Trapping Rain Water (Java) (Hard) (DP)
문제출처: https://leetcode.com/problems/trapping-rain-water/ Trapping Rain Water - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제이해 목표 하나의 배열이 주어진다. 배열에는 해당 인덱스 자리에 블럭의 높이의 값을 나태나는 정보가 주어진다. 블럭과 블럭 사이에 빈공간이 있다면 물을 채울 수 있다. 정확한건 그림을 참조하자. compute how much water it can trap after rai..
LeetCode 152. Maximum Product Subarray (Java) (Medium) (DP)
문제출처: https://leetcode.com/problems/maximum-product-subarray/ Maximum Product Subarray - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제이해 목표 주어진 숫자 Array(nums)에서 연속된 숫자의 곱 중 최댓값이 되는 것을 찾아라 ! ex) [2,3,-2,4] 답: 6 풀이 1. 값이 0인 인덱스들을 찾아서 저장한다. 2. 검사할 배열범위를 (1) 처음 ~ (첫 0의 인덱스 - 1) (2..