1
impl Solution {
2
pub fn uncommon_from_sentences(s1: String, s2: String) -> Vec<String> {
3
let mut map = std::collections::HashMap::new();
4
s1.split(' ')
5
.chain(s2.split(' '))
6
.for_each(|s| *map.entry(s).or_insert(0) += 1);
7
map
8
.iter()
9
.filter_map(|(key, val)| match *val == 1 {
10
true => Some((*key).to_string()),
11
false => None,
12
})
13
.collect::<Vec<_>>()
14
}
15
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0