Please explain the question in detail

can u please help me to build the solution logic from beginning