Partition Labels
easy
1. A string 's' of lowercase English letters is given. 2. We want to partition this string into as many parts as possible so that each letter appears in at most one part. 3. Return a list of integers representing the size of these parts.
Constraints
1. 's' will have length in range [1, 500]. 2. 's' will consist of lowercase English letters ('a' to 'z') only.
Format
Input
s = "ababcbacadefegdehijhklij"
Output
[9,7,8] Explanation: The partition is "ababcbaca", "defegde", "hijhklij". This is a partition so that each letter appears in at most one part. A partition like "ababcbacadefegde", "hijhklij" is incorrect, because it splits s into less parts.
Example
Sample Input
ababcbacadefegdehijhklij
Sample Output
9 7 8