Help me in solving REDCGAME problem

My issue

Can anyone explain the approach…

Problem Link: Reduction Game Practice Coding Problem