Pergunta de entrevista da empresa IXL Learning

Standard leet code style question