Search
⌘K

Leetcode 763. Partition Labels

Partition the string into the maximum number of contiguous parts such that each letter appears in at most one part, and return the sizes of those parts. This is solved by tracking each character's last occurrence and greedily extending the current segment until it covers all last occurrences of characters seen.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.