Strings

First Unique Character

easy
Given a string `s`, find the first non-repeating character in it and return its index. If it does not exist, return `-1`. Example: `firstUniqChar("leetcode")` → `0` (`"l"`).
Hint steps(0/3 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.

  3. 3

    Complete previous step or reveal to unlock this hint.