Skip to content

[FEATURE REQUEST] Add Trapping Rainwater problem in searches section (Java)(Hacktoberfest) #6876

@AdityaNSwain

Description

@AdityaNSwain

What would you like to Propose?

Description

I would like to contribute the implementation of the Trapping Rainwater problem under src/main/java/com/thealgorithms/searches . It focus on computing how much water can be trapped between bars of different heights after raining.

Issue details

Problem Statement

Given an array of non-negative integers representing the elevation map where the width of each bar is 1, compute how much water it can trap after raining.

For Example :

Input : height = [4,2,0,3,2,5]
output : 9

Approach Implemented :
Optimized Two-Pointer Approach
Time Complexity - O(n)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions