Not able to implement it properly

Hii…

I am upsolving this question from codeforces… yesterday challenge…

https://codeforces.com/contest/1469/problem/C

I think i have found the way to check if possible or not…
But i am not able to get that how to update the maxx and minn again…

The logic is for every position i am calculating first the min and max height of ground…

Please see this…
Thanks…

Hey @ashishnnnnn you can watch this video as he’s explained it well


Also i have marked your doubt as mentor attention. Though you can take reference from this video too .