Question d’entretien chez IBM

Leetcode style question from easy to mid range.