LeetCode-Solutions
LeetCode-Solutions copied to clipboard
Trapping Rain Water
Pull Request Template
Description
Link: https://leetcode.com/problems/trapping-rain-water/ Idea:
- We calculate the prefix and suffix max arrays
- The water trapped would be the min of the 2 arrays at a particular index minus the actual height
Put check marks:
Have you made changes in README file ?
- [X] Added problem & solution under correct topic.
- [X] Specified Space & Time complexity.
- [X] Specified difficulty level, tag & Note(if any).
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
- [X] Test A
- [X] Test B
Make sure all below guidelines are followed else PR will get Reject:
- [X] My code follows the style guidelines of this project
- [X] I have performed a self-review of my own code
- [X] I have commented my code so that it is easy to understand
- [X] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [X] Any dependent changes have been merged and published in downstream modules