Meta interview question

Write code to solve the following problem