Add Trapping Rainwater problem implementation (Two Pointer Approach)#6990
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6990 +/- ##
=========================================
Coverage 78.32% 78.33%
- Complexity 6655 6660 +5
=========================================
Files 751 752 +1
Lines 22162 22180 +18
Branches 4353 4357 +4
=========================================
+ Hits 17358 17374 +16
- Misses 4104 4106 +2
Partials 700 700 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @alxkm @yanglbme @DenizAltunkapan 👋 |
DenizAltunkapan
left a comment
There was a problem hiding this comment.
@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
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