Histogram problem


all test case failed ;
please check my code.

Hello @Korou,

Mistakes:

  1. Follow the constraint properly:
    1<=N<=10^6
    Height of each bar in histogram <= 10^9
    So, for the worst case: area would be 10^6*10^9=10^15
    which greater than the range of int.

  2. There are many more mistakes in your code:

Corrected code:
\https://ide.codingblocks.com/s/235919

Refer to comments for better understanding.

Hope, this would help.
Give a like if you are satisfied.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.