First unique character
mediumStrings20 XP
Return the index of the first character in s that appears only once. Return -1 if there is none.
Examples
- Input: s = "krpex"Output: 0
- Input: s = "aabcc"Output: 2
Examples use JSON: true/false/null are True/False/None in Python.