题解 | #判断字符是否唯一#
判断字符是否唯一
https://www.nowcoder.com/practice/fb08c63e2c4f4f7dbf41086e46044211
public boolean isUnique (String str) { // write code here int len = str.length(); HashSet set = new HashSet(len); for (int i = 0; i < len; i++) { set.add(str.charAt(i)); } if (len == set.size()) { return true; }else { return false; } }