Pregunta de entrevista de PEAK6

Question that was around a leetcode medium difficulty