Problem Statement | |||||||||||||
Given a string of lowercase letters, I want to split it up into pieces so that
the letters in each piece are distinct. I want to form as few pieces as possible.
Given theString return a String[] containing the pieces sorted alphabetically.
If more than one way of splitting is minimal, return the sorted sequence of pieces that is first lexicographically. That means that the first element in the sequence that differs is earlier alphabetically. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | theString will contain between 1 and 50 characters, inclusive. | ||||||||||||
- | Each character in theString will be a lowercase letter ('a'-'z'). | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
|