Pergunta de entrevista da empresa Qualtrics

It was a hackerrank question.