pub fn is_unique(word: &str) -> bool {
    if word.len() > 128 {
        return false;
    }
    let mut checker: HashSet<char> = HashSet::new();

    for ch in word.chars() {
        if !checker.contains(&ch) {
            checker.insert(ch);
        } else {
            return false;
        }
    }

    true
}
/// Takes a &str and check that all chars is unique
///
/// Time complexity O(n) and Space complexity O(1)
/// The time complexity can from one side also be O(1) because of that we only check strings
/// that is smaller then 128
///
/// Return true if that the case otherwise returns false
Takes a &str and check that all chars is unique
Time complexity O(n) and Space complexity O(1)
The time complexity can from one side also be O(1) because of that we only check strings
that is smaller then 128

Return true if that the case otherwise returns false
Takes a &str and check that all chars is unique Time complexity O ( n ) and Space complexity O ( 1 ) The time complexity can from one side also be O ( 1 ) because of that we only check strings that is smaller then 128 Return true if that the case otherwise returns false
pub fn is_unique(word: &str) -> bool {
    if word.len() > 128 {
        return false;
    }
    let mut checker: HashSet<char> = HashSet::new();
    for ch in word.chars() {
        if !checker.contains(&ch) {
            checker.insert(ch);
        } else {
            return false;
        }
    }
    true
}
pub fn is_unique ( word : & str ) -> bool { if word . len ( ) > 128 { return false ; } let mut checker : HashSet < char > = HashSet :: new ( ) ; for ch in word . chars ( ) { if ! checker . contains ( & ch ) { checker . insert ( ch ) ; } else { return false ; } } true }
Takes a &str and check that all chars is unique
Time complexity O(n) and Space complexity O(1)
The time complexity can from one side also be O(1) because of that we only check strings
that is smaller then 128
Takes a &str and check that all chars is unique Time complexity O ( n ) and Space complexity O ( 1 ) The time complexity can from one side also be O ( 1 ) because of that we only check strings that is smaller then 128
word
&str
word
&str