public static boolean hasUniqueCharacters1(String str){
        Set<Character> set = new HashSet<Character>();
        for(Character ch : str.toCharArray()){
            if(set.contains(ch)){
                return false;
            }else{
                set.add(ch);
            }
        }
        return true;
    }