Question d’entretien chez Sabre

Given sorted dictionary find precedence characters