PythiloEasy · 10 min · Task 3 of 20 · progress kept in this browser

First character seen once

Given a string, find the position of the first character that appears exactly once. Upper and lower case count as different characters.

first_unique("stress")  # 1, the "t"
first_unique("aabb")    # -1
Your task

Write first_unique(text) returning the index of the first character that occurs exactly once, or -1 if there is none.