Ash914027 / leetcodeproblem

leetcode with problrm:LeetCode Solutions Repository This repository contains solutions to various LeetCode problems implemented in C++ and Java. The project aims to provide efficient and optimized solutions to coding challenges on the popular online coding platform, LeetCode
0 stars 7 forks source link

Trapping Rain water #6

Open Avnee29 opened 3 days ago

Avnee29 commented 3 days ago

The problem "Trapping Rain Water" aims to compute how much water can be trapped between bars of different heights after it rains.

Approach Explanation:

To solve this problem efficiently, we can use a two-pointer approach which works in O(n) time complexity. This approach leverages two pointers to traverse the elevation map from both ends, calculating the trapped water by keeping track of the maximum heights from the left and the right as we move inward.

Please assign me this issue under Hactoberfest 2024.

Ash914027 commented 3 days ago

CREATE THE PULL REQUEST