Pregunta de entrevista de Rapid7

it was 1 easy leetcode question