Udemy interview question

How would you solve the following coding challenge?