Question d’entretien chez IMC Trading

Basic DP question involving substrings