Easy15 pts
First Unique Character
Given a string s, find the first non-repeating character and return its index. Return -1 if none exists. Count character frequencies, then find first with count 1. Example: 'leetcode' → 0 (l appears once, is first)
Input
A single line containing a string.
Output
The index (0-based) or -1.
Sample
leetcode
Expected
0
Loading editor…
Output
No output yet. Run your code to see results.