-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trapping rain water problem using c++(Optimised) #567
Conversation
@vishvarana |
The maximum heights chosen will be 8 and 7 that is 2nd and last element of the array. |
The idea is to maximize the area to trap water by both heights as well as base length. |
Smallest distinct window problem using c++ |
Please review |
@vishvarana add comments and explain the question in the code. Also add complexities. |
Trapping the rain water - I have explained the problem in previous comments Smallest distinct window in a string containing all other characters of the string : |
There are 2 solutions added and both explained with complexities. |
@vishvarana I am asking you to add the description and complexities as comments in the code file. |
@vishvarana, Also place the file in appropriate folder. |
…n and complexities
Required changes made. |
New PR made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then delete smallestdistinctwindow.cpp in this PR as it is not related to this. Also, delete the unnecessary (repetitive) files (which are not placed in any folder).
Required changes done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Just add some comments to explain your core logic.
Added comments in the cpp file |
Good work @vishvarana |
Have you read the Contributing Guidelines on Pull Requests?
Yes
Description
The problem is what most amount of rain water can the container store with different heights of the walls given as an array.
Checklist
Related Issues or Pull Requests
#278
Fill up the DCP form
If you are a part of DCP 21, fill up this form after the PR is merged.
The links provided in the form will be checked thoroughly, if someone tries fooling around, strict actions will be taken against the individual.