Description
10. First Unique Character in a String

Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1. You must assume the string contains only lowercase English letters.

Example 1

Input:  "ronri"
Output: 1

Example 2

Input:  "coding"
Output: 0

Example 3

Input:  "aabb"
Output: -1
Constraints:
    • 1 <= s.length <= 10^5
    • The string s consists only of lowercase English letters.
Test Cases

Case 1
Case 2
Case 3

Input

"ronri"

Output

1