Question d’entretien chez Thomson Reuters

Leetcode question, very basic, doable