NIKE Interview Question

Solve this coding problem in 20 minutes