We define the goodness of a string S as the number of letters that appear in S only once. For instance, the goodness of the string "CHALLENGE" is 5 because it contains 5 distinct letters 'C', 'H', 'A', 'N' and 'G'.
You are given a String[] superstring. superstring is split for convenience only, so you should concatenate all of its elements in order and treat it as a single string. You are to find the substring of superstring that has the maximal goodness. In case of a tie, return the substring that comes earliest alphabetically.
|