How to solve this problem?


Could not think of any logic on this problem. Was stuck for 1 hour. How to approach this?