이 글은 "파이썬 알고리즘 인터뷰 (박상길 지음)"을 읽고 주관적으로 요약한 글입니다. 문제 정의 높이에 따라 쌓일 수 있는 물의 총계 계산 책에서 구현된 코드 def trap(self, height: list[int]) -> int: if not height: return 0 volume = 0 left, right = 0, len(height) - 1 left_max, right_max = height[left], height[right] while left < right: left_max, right_max = max(height[left], left_max), max(height[right], right_max) if left_max int: stack = [] volume = 0 for i in..