Need HELP with VISION coding problem

I need help with question 3 (VISION) of JUNE Long Challenge 2018. I can’t find a logical approach to solve this question and moreover, there isn’t an editorial for this problem. Somebody please explain me some approach to solve this question?
Here’s the question link for the same: