11. Container With Most Water
·
Algorithm/LeetCode
문제각 위치의 높이를 나타내는 정수 배열이 주어진다. 두 위치 간 높이에 따른 최대 부피를 계산하는 문제이다.Constraints:n == height.length2 0 링크https://leetcode.com/problems/container-with-most-water/Solution 1class Solution { public int maxArea(int[] height) { int max = 0; int n = height.length; for(int i=0;i문제를 읽고 직관적으로 생각한 풀이 방식이다.시간 복잡도: O(n^2)타임 초과 발생!Solution 2class Solution { public int maxArea(int[] height..