← 返回 amazon 的题目列表First Unique Character Index in String (1-Based)
类型:online_judge
amazon
Given a string of lowercase English characters, find the index of the first unique character. A unique character is one that appears only once in the string. Return its index (1-based index). If no such character exists, return -1.
Example
Input: "statistics" Output: 3
Constraints
The length of the string is between [1, 10^5].
Example
Input
statistics