Pregunta de entrevista de JWP (JW Player)

(HackerRank code challenge) Slightly complicated fizzbuzz question