Question d’entretien chez Dunzo

Sequential Question - codeforces Medium/Hard question from leetcode