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;
}

你可能感兴趣的:(CI)