Problem
Cut the string s into as many pieces as possible so that every letter appears in at most one piece. Return the sizes of the pieces, in order.
Example 1
- Input
- s = "abcabdde"
- Output
- [5, 2, 1]
- Why
- "abcab", "dd", "e"
Example 2
- Input
- s = "caedbdedda"
- Output
- [1, 9]
- Why
- "c", "aedbdedda"
Example 3
- Input
- s = "eccbbbbdec"
- Output
- [10]
- Why
- one piece holds everything
Constraints
1 <= s.length <= 500s contains only lowercase English letters.