What is stack technique in dynamic programming and how can I apply it to solve 1131G - Most Dangerous Shark. I can implement the dynamic programming solution of that problem which is mentioned in the editorial( and I know there is a typo ) but it will get TLE. And I don't know about stack technique to take minimum of dp state in a range. So someone please explain it or give me some useful links.
Thanks in advanced :)