Pregunta de entrevista de Framestore

Basic coding question regarding how I would handle the logic