Pattern Recognition Drill
Easy Hash Maps
The Problem
Find the index of the first character that appears only once.
What approach would you use?
Think about it before scrolling down.
Pass 1: count frequencies. Pass 2: scan left-to-right, return first count==1. O(n).
Common Trap
Nested loops checking each character against all others is O(n²). Counter reduces to O(n).