give string s lowercase letter need find maximum number nonempty substring s meet follow conditionsthe substring overlap substring sij sxy j x y trueA substring contain certain character c contain occurrence cFind maximum number substring meet condition if multiple solution number substring return minimum total length it show exist unique solution minimum total lengthnotice return substring order Example 1input s adefaddacccoutput efcccexplanation the follow possible substring meet condition adefaddaccc adefadda ef e f cccIf choose string choose we d 1 if choose adefadda leave ccc do not overlap obtain 2 substring Notice optimal choose ef split therefore optimal way choose efccc give 3 substring no solution number substring existexample 2input s abbaccdoutput dbbccexplanation Notice set substring dabbacc length 3 consider incorrect large total length Constraints1 slength 105s contain lowercase english letter