1459: 第一个唯一字符
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:134
Solved:58
Description
给定一个字符串,找到它的第一个不重复的字符,并返回它的索引。如果不存在,则返回 -1。
示例1: s = "leet”
返回 0
示例2: s = “nineteen”
返回 1
Input
输入一个字符串,由小写字母构成(a-z)。
Output
输出第一个不重复的字母出现的位置(从0开始)。
Sample Input Copy
nineteen
Sample Output Copy
1
HINT
假设字符串均由小写字母构成。且最长不超过1000000。