https://leetcode.com/problems/first-unique-character-in-a-string
387. First Unique Character in a String
给一个字串s,找到第一个不重复的字符回传其索引,不存在则回传-1
Example 1:
Input: s = "leetcode"
Output: 0
Example 2:
Input: s = "loveleetcode"
Outpue: 2
Example 3:
Input: s = "aabb"
Output: -1
思路:
用for循环找出只出现一次的字符
Python3 code: