ctci1.1

bool check(char * str){
    if(str == NULL)
        return true;
    int len = strlen(str);
    if(len == 0)
        return true;
    map<char,bool> place;
    int i = 0;
    for(i = 0; i < len; i++){
        if(place.find(str[i]) == place.end())
            place.insert(pair<char,bool>(str[i],true));
        else
            return false;
    }
    return true;
}
原文地址:https://www.cnblogs.com/jilichuan/p/4013089.html