First Unique Character

Given a string, find the first character that appears exactly once in the string and return its index. If every character repeats or the string is empty, return -1.

Examples
Input: "leetcode"
Output: 0
Hints

First Unique Character

Return the index of the first character in a string that appears exactly once, or -1 when no such character exists.