JWP (JW Player) interview question

(HackerRank code challenge) Extremely simple warmup question