Pregunta de entrevista de The Trade Desk

Common interview-style problem in JS