Pergunta de entrevista da empresa Rapid7

it was 1 easy leetcode question