mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 20:40:39 +08:00
Update 0042.接雨水.md
修改代码格式
This commit is contained in:
@ -422,7 +422,8 @@ class Solution {
|
|||||||
|
|
||||||
单调栈法
|
单调栈法
|
||||||
```java
|
```java
|
||||||
public int trapMonoStack(int[] height){
|
class Solution {
|
||||||
|
public int trap(int[] height){
|
||||||
int size = height.length;
|
int size = height.length;
|
||||||
|
|
||||||
if (size <= 2) return 0;
|
if (size <= 2) return 0;
|
||||||
@ -463,6 +464,7 @@ class Solution {
|
|||||||
|
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Python:
|
Python:
|
||||||
|
Reference in New Issue
Block a user