Partition Labels
mediumPartition string so each letter appears in at most one part
Partition Labels
Key Insight
Track last occurrence of each char. Extend partition until index equals end.
Step 1Track Last Occurrences
last: a=8, b=5, c=7
a
0b
1a
2b
3c
4b
5a
6c
7a
8For "ababcbaca": a→8, b→5, c→7
1 / 5