CodeMentor.
Ask AIProblemsLearnC++TCSCore CSHRProgress
0Lv 1
ProblemsHashing

First Unique Character

Easy
LeetCode
5/8
EasyHashingLeetCode #387

First Unique Character in a String

Count frequencies, then second pass for first index with count 1.

Examples

Example 1

Input

leetcode

Output

0
Example 2

Input

loveleetcode

Output

2

Stuck? Take a nudge

C++17Autosaves