修正
This commit is contained in:
parent
7c88ef05d1
commit
d85429aad4
@ -1,31 +0,0 @@
|
|||||||
//给定一个直方图(也称柱状图),假设有人从上面源源不断地倒水,最后直方图能存多少水量?直方图的宽度为 1。
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// 上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的直方图,在这种情况下,可以接 6 个单位的水(蓝色部分表示水)。 感谢 Marco
|
|
||||||
//s 贡献此图。
|
|
||||||
//
|
|
||||||
// 示例:
|
|
||||||
//
|
|
||||||
// 输入: [0,1,0,2,1,0,1,3,2,1,2,1]
|
|
||||||
//输出: 6
|
|
||||||
// Related Topics 栈 数组 双指针
|
|
||||||
// 👍 168 👎 0
|
|
||||||
|
|
||||||
package leetcode.editor.cn;
|
|
||||||
//面试题 17.21:直方图的水量
|
|
||||||
public class VolumeOfHistogramLcci{
|
|
||||||
public static void main(String[] args) {
|
|
||||||
//测试代码
|
|
||||||
Solution solution = new VolumeOfHistogramLcci().new Solution();
|
|
||||||
}
|
|
||||||
//力扣代码
|
|
||||||
//leetcode submit region begin(Prohibit modification and deletion)
|
|
||||||
class Solution {
|
|
||||||
public int trap(int[] height) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//leetcode submit region end(Prohibit modification and deletion)
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user