Qualtrics interview question

Mostly Leetcode medium and a hard