class Solution { public: int FirstNotRepeatingChar(string str) {

    if(str.empty())  return -1;
    if(str.length() == 1)  return 0;
    
    for(int i=0;i<str.length();i++)
    {
        if(str.find_first_of(str[i]) == str.find_last_of(str[i]))
        {
           return i;
        }

    }
    
    return -1;
}

};