← 返回 microsoft 的题目列表Remove Duplicate Letters Preserving First Occurrence Order
类型:online_judge
microsoft
Given a string, remove duplicate letters so that every letter appears only once. You need to return a new string with the characters in the order they first appear in the original string.
Input
A string inputString containing lowercase letters.
Output
A de-duplicated string.
Example
Input: "aabbcccddd"
Output: "abcd"
Constraints
The length of the string does not exceed 1000.
Example
Input
aabbcccddd