wrong output
Largest area under histogram
- insert i instead of element
- before poping the element store the element
st=s.top();
s.pop();
- correct formula is
area=arrr[i]*(st-i+1);
still wrong output
your code has many mistakes
this is modified code
it is showing segmentation falt
still showing segmentation fault
you have not change the size of array
as explained above
it is of the order 10^9
make it 10^7
look at constraints carefully
Constraints
1<=N<=10^6
Height of each bar in histogram <= 10^9
max size of array is 10^6
try again this code after changing size of array is running for me

