Can someone help me, I didnt understand anything from the editorial


#1

I’m pretty bad at dp, and I cannot find any one else explaining this question