Meta Interview Question

Write code to solve the following problem