LeetCode-Solutions icon indicating copy to clipboard operation
LeetCode-Solutions copied to clipboard

Added trapping rainwater in cpp

Open nikkilaprakash opened this issue 4 years ago • 1 comments

Pull Request Template

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. Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6

For the solution, we calculate the maximum heights to the left and the right, and decide the amount of stagnant water accordingly

Put check marks:

Have you made changes in README file ?

  • [ ] Added problem & solution under correct topic.
  • [ ] Specified Space & Time complexity.
  • [ ] 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.

  • [ ] Test A
  • [ ] 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
  • [ ] I have commented my code so that it is easy to understand
  • [ ] I have made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] Any dependent changes have been merged and published in downstream modules

nikkilaprakash avatar Oct 13 '21 17:10 nikkilaprakash

I can tell this is your first pull request! Thank you I'm so honored. :tada::tada::tada: I'll take a look at it ASAP!

welcome[bot] avatar Oct 13 '21 17:10 welcome[bot]