Https://online.codingblocks.com/player/29771/content/7349/4750 . not able to understand anything in this question

pls tell me how to approach. not getting any logic