#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
# 
# @param str string字符串 
# @return int整型
#
class Solution:
    def FirstNotRepeatingChar(self , str: str) -> int:
        # write code here
        n = len(str)
        for i in range(n+1):#数组下标为n已越界,数组已经便利完,没找到满足条件的元素
            if i == n:
                return -1
            elif str.count(str[i])==1:#判断当前数组的元素是否满足要求,满足要求则返回下标并退出遍历
                return i
                break