Help on a question

Anyone please share code or effective approach