How to solve this kind of problem?
Link: https://toph.co/p/cut-the-rope Which algorithm suits this kind of problems? I tried segment tree.