Given a string, partition it into as many parts as possible so that each letter appears in at most one part. Return the sizes of these parts. For , the answer is . The first part is "ababcbaca" where all letters a, b, c only appear there.
This requires tracking where each character last appears.
Think about how that information helps you decide where to cut.
Without knowing last positions, you cannot determine partition boundaries.