- 
                Notifications
    
You must be signed in to change notification settings  - Fork 20.7k
 
Add Trapping Rainwater problem implementation (Two Pointer Approach) #6990
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
base: master
Are you sure you want to change the base?
Conversation
          Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@            Coverage Diff            @@
##             master    #6990   +/-   ##
=========================================
  Coverage     78.34%   78.34%           
- Complexity     6621     6644   +23     
=========================================
  Files           747      749    +2     
  Lines         22036    22118   +82     
  Branches       4322     4344   +22     
=========================================
+ Hits          17264    17329   +65     
- Misses         4085     4092    +7     
- Partials        687      697   +10     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
| 
           Hi @alxkm @yanglbme @DenizAltunkapan  👋  | 
    
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.
@Arzoo1701 Please always add a corresponding test class if you're adding a new algorithm/class. Thank you for your contribution.
          
 @DenizAltunkapan The requested test class has been added and all checks have passed. Please review and merge when possible. Thank you!  | 
    
| 
           @Arzoo1701 are you sure that both classes should stay in the search package? it seems that this is not a search algorithm  | 
    
| 
           @DenizAltunkapan  | 
    
19be1e2    to
    b959623      
    Compare
  
    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.
b8ed7b0    to
    76ff418      
    Compare
  
    | 
           there is still a changed line in the pom.xml @Arzoo1701  | 
    
Description
This PR adds an implementation of the Trapping Rainwater problem using the Two Pointer approach under
src/main/java/com/thealgorithms/searches.Problem Statement
Given an array of non-negative integers representing elevation map heights, compute how much water can be trapped after raining.
Example
Input: [4, 2, 0, 3, 2, 5]
Output: 9
Approach
Wikipedia – Trapping Rain Water
Related Issue
Fixes #6876
clang-format -i --style=file path/to/your/file.java