1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-13 01:15:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2025-09-29 14:43:44 +08:00
parent 2862a227c4
commit 13f2098086
4409 changed files with 168933 additions and 166256 deletions

View File

@@ -1,10 +1,11 @@
<p>给定一个直方图(也称柱状图),假设有人从上面源源不断地倒水,最后直方图能存多少水量?直方图的宽度为 1。</p>
<p><img src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/10/22/rainwatertrap.png" style="height: 161px; width: 412px;"></p>
<p><img src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/10/22/rainwatertrap.png" style="height: 161px; width: 412px;" /></p>
<p><small>上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的直方图,在这种情况下,可以接 6 个单位的水(蓝色部分表示水)。&nbsp;<strong>感谢 Marcos</strong> 贡献此图。</small></p>
<p><strong>示例:</strong></p>
<p><strong>示例</strong></p>
<pre><strong>输入:</strong> [0,1,0,2,1,0,1,3,2,1,2,1]
<strong>出:</strong> 6</pre>
<pre>
<strong>入:</strong>[0,1,0,2,1,0,1,3,2,1,2,1]
<strong>输出:</strong>6</pre>