Plz check my code not satisfying all testcases

Can you tell me the topic regarding your doubt. Actually i received your doubt as doubt on rainwater harvesting. But your code is totally different.

sorry this is the code plz check it

the order of n in question is 10^6 but you have taken less elements in array.