Sir please help in problem "help ramu"

i am unable to understand any logic for this question

@Tanna hey tanna this is the link for the help ramu problem in which prateek bhaiya taught this problem in the brief help ramu.