We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa81d5b commit 13831e6Copy full SHA for 13831e6
C++/trapping-rain-water.cpp
@@ -4,7 +4,7 @@
4
class Solution {
5
public:
6
int trap(vector<int>& height) {
7
- int result = 0, left = 0, right = height.size()-1, level = 0;
+ int result = 0, left = 0, right = height.size() - 1, level = 0;
8
while (left < right) {
9
int lower = height[height[left] < height[right] ? left++ : right--];
10
level = max(level, lower);
0 commit comments