Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 124: Maps: Fundamentals
Implement `firstUnique(str)` that returns the index of the first character in `str` that appears only once. Return `-1` if none exists.
+ 2 hidden tests run on Submit.
Count characters, then scan again for the first with count one. O(n) time and space.
Run your code to see results.