src/com/ctci/arrays_string/IsUnique.java
// the ASCII extend include the 128 characters and intatal is 256 chars
the ASCII extend include the 128 characters and intatal is 256 chars
the ASCII extend include the 128 characters and intatal is 256 chars
public boolean isUnique(String s) {
        if (s == null || s.isEmpty()) return true;
        Set<Character> characterSet = new HashSet<>();
        for (int i = 0; i < s.length(); i++) {
            characterSet.add(s.charAt(i));
        }
        boolean result = characterSet.size() == s.length();
        return result;
    }
public boolean isUnique ( String s ) { if ( s == null || s . isEmpty ( ) ) return true ; Set < Character > characterSet = new HashSet < > ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { characterSet . add ( s . charAt ( i ) ) ; } boolean result = characterSet . size ( ) == s . length ( ) ; return result ; }
the ASCII extend include the 128 characters and intatal is 256 chars
the ASCII extend include the 128 characters and intatal is 256 chars
//set can't not hold duplicated value, so check the length of the set and the string