Skip to content

Instantly share code, notes, and snippets.

View bdesemb's full-sized avatar
🎯
Focusing

Benoit Desemberg bdesemb

🎯
Focusing
  • Brussels, Belgium
View GitHub Profile

Keybase proof

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:

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 += " ";
}