Qualtrics Interview Question

It was a hackerrank question.