← 返回 jpmorgan 的题目列表Remove Smallest Substring to Ensure Unique Characters
类型:online_judge
jpmorgan
Given a string, remove the smallest substring such that the remaining string contains all unique characters. Implement a function to complete this task.
Input:
A string s with upper and lower case letters.
Output:
The string after removing the smallest substring.
Test Cases:
Input: "abac"
Output: "bac"
Input: "abcabc"
Output: "cab"
Input: "aabbcc"
Output: "abc"
Input: "aabacbe"
Output: "acbe"
Input: "abcde"
Output: "abcde"
Example
Input
abac