Histogram area problem

my code is giving tle

hello @Megha2468
image

here it should be pop in place top .

my ans is coming 42 but it should be 12

getting run error while submitting

getting the correct ans but when I am submitting the code then i am getting run error

pls share ur updated code .i will check.
use cb ide for code sharing

increase ur array size.
check maximum value of n and declare ur array size accordingly

check ur updated code here-> https://ide.codingblocks.com/s/254122

ok thank you it worked