【leetcode】字符串中的第一个唯一字符

int firstUniqChar(char * s){
    int hash[128]={0},i,len=strlen(s);
    for (i=0; i<len; i++) 
        hash[s[i]]++;

    for (i=0; i<len; i++)
        if (hash[s[i]] == 1) return i;

    return -1;
}
原文地址:https://www.cnblogs.com/ganxiang/p/13743932.html