Question d’entretien chez Bloomberg

one leetcode style question: longest substring