Problem
Given a string s, return the **index of the first character that appears exactly once** in it. If every character repeats, return -1.
Example 1
- Input
- s = "leetcode"
- Output
- 0
- Why
- l
Example 2
- Input
- s = "loveleetcode"
- Output
- 2
- Why
- v
Example 3
- Input
- s = "aabb"
- Output
- -1
Constraints
1 <= s.length <= 10^5s contains only lowercase English letters.