First Unique Character
Easy
Strings
String
Hash Table
Given a string, find the index of the first non-repeating character. Return -1 if none.
Constraints
1 ≤ s.length ≤ 10^5
Examples
Example 1:
Input: leetcode
Output: 0
Example 2:
Input: loveleetcode
Output: 2
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console