First Unique Character

L3 Easy Strings
Concept
Some questions need two passes: first gather global knowledge (counts), then walk the input again and act on it.
Given a string s, return the index of the first character that appears exactly once. If every character repeats, return -1.
Examples
▸ s = "swift"
→ 0
▸ s = "aabb"
→ -1
▸ s = "abcaab"
→ 2
Progressive Hints
Hint 1 · Nudge
Two passes: count everyone first, then find the first one with a lonely count.
Hint 2 · Plan
Pass one builds a frequency map of s. Pass two walks s left to right and returns the first index whose character has a count of exactly 1. If you finish without finding one, return -1.
Hint 3 · Approach
counts = frequency map of s. For each i, c in s: if counts[c] == 1, return i. Return -1.
Output
// Run your code to see the output here.