Grant Street Group Interview Question

Print sorted list of substrings count given an input string