I didn’t get the histogram area problem. Can anyone kindly explain?
So, I know like,
push(): jab current bar ki value previous bar ki value se larger ho then push in the stack,
WHY!!
pop(): agar current bar ki value previous bar ki value se smaller hai then pop from the stack,
WHY!!
case 1: agar pop karne ke baad stack empty nai hai then
‘i’ is the variable signifies current bar index
width=(i-s.top()-1)
length=hist[s.top()]
area=length*width
case 2: agar pop karne ke baad stack empty hai then
‘i’ is the variable signifies current bar index
width=i
length=hist[s.top()]
area=length*width
PS. I watched Prateek Bhaiya’s video so don’t attach any video if you’re thinking like that.