Pergunta de entrevista da empresa D. E. Shaw India

lexicographic ordering of substrings of a string?