fn check_passphrase(passphrase: &str) -> bool {
    let words: Vec<&str> = passphrase.split_whitespace().collect();

    let mut hm = HashMap::<String, bool>::new();

    for word in words {
        let sorted_word = sort(word);
        match hm.entry(sorted_word) {
            Entry::Occupied(_) => return false,
            Entry::Vacant(v) => v.insert(true),
        };
    }

    true
}
//
// Return true if each word in the passphrase is unique;
// otherwise, return false
//
Return true if each word in the passphrase is unique;
otherwise, return false
Return true if each word in the passphrase is unique ; otherwise return false
fn check_passphrase(passphrase: &str) -> bool {
    let words: Vec<&str> = passphrase.split_whitespace().collect();
    let mut hm = HashMap::<String, bool>::new();
    for word in words {
        let sorted_word = sort(word);
        match hm.entry(sorted_word) {
            Entry::Occupied(_) => return false,
            Entry::Vacant(v) => v.insert(true),
        };
    }
    true
}
fn check_passphrase ( passphrase : & str ) -> bool { let words : Vec < & str > = passphrase . split_whitespace ( ) . collect ( ) ; let mut hm = HashMap :: < String , bool > :: new ( ) ; for word in words { let sorted_word = sort ( word ) ; match hm . entry ( sorted_word ) { Entry :: Occupied ( _ ) => return false , Entry :: Vacant ( v ) => v . insert ( true ) , } ; } true }
Return true if each word in the passphrase is unique;
otherwise, return false
Return true if each word in the passphrase is unique ; otherwise return false
passphrase
&str