Given a string s, return the index of the first character that appears exactly once. Return -1 if every character repeats.
Example 1
Input s = "leetcode"Output 0The first unique character is "l".
Example 2
Input s = "loveleetcode"Output 2Example 3
Input s = "aabb"Output -1Constraints & assumptions
- 1 ≤ len(s) ≤ 100,000
- s contains lowercase English letters
- Aim for O(n) time