42. 接雨水(Trapping rain water)

題目描述 LeetCode.cn地址:https://leetcode-cn.com/problems/trapping-rain-water/ LeetCode地址:https://leetcode.com/problems/trapping-rain-water/ 思路 首先求出最大值的索引,設爲i1,然後向左遍歷,求出左邊範圍內的最大值,記索引爲i2,以i2和i1對應值之間爲容器,雨水可以存
相關文章
相關標籤/搜索