Pregunta de entrevista de Atlassian

Hackerank, about leetcode easy-medium difficulty