当使用字符串的子串时,如果可以用索引代替,那么可以不要用substring
如:
public boolean allUnique(String s, int start, int end) {
Set<Character> set = new HashSet<>();
for (int i = start; i < end; i++) {
Character ch = s.charAt(i);
if (set.contains