← 返回 bloomberg 的题目列表Find the k-th Unique Character
类型:online_judge
Given a string, find the k-th unique character in it. If no such character exists, return a value indicating the absence.
Input Description:
A string s
An integer k indicating the order of the unique character to find
Output Description:
If the k-th unique character exists, return it; otherwise, return a special character indicating absence, such as None or '-'
Constraints:
The length of the string is within [1, 10^5]
The string contains only lowercase English letters and special symbols
Example:
Input: s = "aabbccddexyzz", k = 2
Output: x
Input: s = "aabbcc", k = 1
Output: '-'
Example
Input
aabbccddexyzz
2