给定一个字符串,请你判断其中每个字符是否全都不同。
数据范围:字符串长度满足
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str string字符串 * @return bool布尔型 */ int cmp(const void* e1,const void* e2){ return *((char*)e1)-*((char*)e2); } bool isUnique(char* str ) { // write code here qsort(str,strlen(str),1,cmp); for(int i=1;i<strlen(str);i++){ if(str[i]==str[i-1]) return false; } return true; }