Report question

Question: Interview Question... Trying to work it out, but couldn't get an efficient solution