剑指offer---第一个只出现一次的字符
class Solution { public: int FirstNotRepeatingChar(string str) { int str_size = str.size(); for (int i = 0; i < str_size; ++i) { for (int j = 0; j < str_size; ++j) { if (i == j) { continue; } else if (str[i] == str[j]) { break; } else if (j == (str_size - 1) && str[j] != str[i]) { return i; } } } return -1; } };
没用哈希