akshitagit / JAVA

Repository for Java codes and algos.Star the repo too.
https://github.com/akshitagupta15june
MIT License
90 stars 127 forks source link

RAIN WATER SAVING-INTERVIEW QUESTION(FAANG) #47

Closed akshitagupta15june closed 3 years ago

akshitagupta15june commented 3 years ago

AKSHITA has created an elevated roof. She wants to know how much water can she save during rain.

Given n non negative integers representing the elevation map where width of every bar is 1, Find the maximum water that she can save.

Explanation for the Sample input Testcase: image

Elevation Map Input Format

First line contains an integer n. Second line contains n space separated integers representing the elevation map. Constraints

1 <= N <= 10^6 Output Format

Print a single integer containing the maximum unit of waters she can save. Sample Input

10 0 2 1 3 0 1 2 1 2 1

Sample Output

5

akshitagupta15june commented 3 years ago

ADD IN INTERVIEW QUESTION REPO

idodin commented 3 years ago

Hi, I'd like to work on this.

akshitagupta15june commented 3 years ago

ok assigning to u

akshitagupta15june commented 3 years ago

PROCESS OF CONTRIBUTION IN THIS REPOSITORY

FORK THIS REPOSITORY ADD YOUR CODE IN RESPECTIVE FOLDER CREATE A PULL REQUEST AFTER A SIMPLE CHECK I WILL MERGE THE PR

HAPPY CODING AND CONTRIBUTING!!!!

SiddharthShukla547 commented 3 years ago

Hey, I would Like to work on this