Posts

Showing posts from October, 2025

trapping the rain water

  class Solution { public:     int trap(vector<int>& height) {         vector<int>a;         vector<int>b;        min[height[i-1],height[i+1]];         for(int i=0;i<height.size()-1;i++){             if(height[i]<height[i+1] && height[i]<height[i-1]){                 min[height[i-1],height[i+1]];;             }         }     } };