class Solution {
public boolean isUnique(String astr) {
boolean flag = true;
int count = astr.length();
if (count != 0 || count != 1){
for (int i = 0; i < count; i++){
if (astr.indexOf(astr.charAt(i)) != astr.lastIndexOf(astr.charAt(i))){ // 利用索引判断从左从右索引值是否相同
flag = false;
}
}
}
return flag;
}
}