Qualtrics interview question

Relatively easy leet code question