NIKE interview question

Solve this coding problem in 20 minutes