Apple interview question

How would you code a solution