You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
2
+
3
+
classSolution
4
+
{
5
+
public:
6
+
inttrap(vector<int>& height)
7
+
{
8
+
if (height.size() < 3) { return0; }
9
+
10
+
// Get the indices of two highest bars, sort them and put into top2bars
0 commit comments