Pregunta de entrevista de SimVentions

Asked a Leetcode style algorithm challenge