I hereby claim:
- I am bdesemb on github.
- I am bdesemb (https://keybase.io/bdesemb) on keybase.
- I have a public key ASCaHpY795r5YRY2zS-DgZcNugPkGdNyygR1MEnal4sZGwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
use std::collections::HashSet; | |
fn remove_duplicate_words(s: &str) -> String { | |
let mut set: HashSet<&str> = HashSet::new(); | |
let mut result = String::new(); | |
for x in s.split(' ') { | |
if set.insert(x) { | |
result += x; | |
result += " "; | |
} |