Your question is First Unique Character Index. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a string s, return the index of the first character that appears exactly once. If no such character exists, return -1. Implement the solution in Python using an efficient approach based on character frequency counting.
def first_unique_char(s):