Histogram problem problme - https://online.codingblocks.com/app/player/37688/content/70889/4880/code-challenge

sol - https://ide.codingblocks.com/s/203019
MY code gives right output but testcase fail ??

Hi @sudhanshu8917,
replace all int with long long,
rest of ur code is fine.

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.

it is still not being submitted !!!

@sudhanshu8917 in else case of the function, you need to run a while loop because there may be multiples bars which are present in the stack but less than the current bar.
so just modify your code by using a look like while(arr[s.top()] < arr[i])

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.