Leetcode 42 – Trapping Rain Water | Two Pointer

Trapping Rain Water

Problem Description: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1 : Example 2: Constraints: Problem Link :Trapping Rain Water – LeetCode Solution(s): Approach 1: Brute Force Solution Java Code: Explanation: 1.Initialization: 2.Main Loop: 3.Finding Maximum Height to the Left: … Read more