Pregunta de entrevista de Scale

Had to write helper code for their codebase