loading…
Write first_unique(s) returning the index of the first character that appears exactly once, or -1.
first_unique("leetcode") -> 0
first_unique("loveleetcode") -> 2
first_unique("aabb") -> -1
Stuck on the idea itself? The strings lesson walks through the pattern from scratch.