Back to DSA
Partition Labels
mediumSplit a string into the maximum number of contiguous segments such that every character appears in at most one segment. Return the lengths of those segments in order.
Examples
Example 1:
Input:
s = "xyzxabcabc"Output:
[4,6] Example 2:
Input:
s = "abcabc"Output:
[6]Hints
1234567