How to approach this problem

please tell the logic required to solve this problem

@pragyachoudhary1111 hey pragya
See this video