Given a string s of lowercase English letters, find the maximum number of non overlapping substrings that meet the following criteria:
If a character appears in a chosen substring, all occurrences of that character in s must also be contained within that same substring.
No two chosen substrings may overlap.
If there are multiple valid collections of substrings that achieve the maximum possible count, return the one that minimizes the total sum of their lengths. The substrings may be returned in any order.
Constraints:
s.length
s contains only lowercase English letters.
Given a string s of lowercase English letters, find the maximum number of non overlapping substrings that meet the following criteria:
If a character appears in a chosen substring, all occurrences of that character in s must also be contained within that same substring.
No two chosen substrings may overlap.
If there are multiple valid collections of substrings that achieve the maximum possible count, return the one that minimizes the total sum of their lengths. The substrings may be returned in any order.
Constraints:
s.length
s contains only lowercase English letters.