CPP icon indicating copy to clipboard operation
CPP copied to clipboard

RAIN WATER SAVING-INTERVIEW QUESTION (FAANG)

Open akshitagupta15june opened this issue 4 years ago • 5 comments

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 avatar Sep 25 '20 18:09 akshitagupta15june

ADD CODE IN INTERVIEWQUESTIONS REPO

akshitagupta15june avatar Sep 25 '20 18:09 akshitagupta15june

I would like to work on this.Can you assign to me?

Maitryee-Choudhary avatar Sep 26 '20 11:09 Maitryee-Choudhary

Ok assigning to u

akshitagupta15june avatar Sep 26 '20 11:09 akshitagupta15june

Thank you! I will submit my PR on 1st October

Maitryee-Choudhary avatar Sep 26 '20 12:09 Maitryee-Choudhary

can you please assign me

kritika122000 avatar Sep 28 '20 16:09 kritika122000