← 返回 walmartlabs 的题目列表Find the First Unique Character in a String
类型:online_judge
Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1.
Input description:
A string containing only lowercase English letters.
Output description:
An integer representing the index position of the first non-repeating character.
Example 1:
Input: "leetcode" Output: 0
Example 2:
Input: "loveleetcode" Output: 2
Constraints:
The string length will not exceed 10^5.
Example
Input
leetcode