← Quit0 / 0 correct
What is the idiomatic, single-lookup way to count word frequencies?
let mut counts: HashMap<&str, usize> = HashMap::new();
for w in text.split_whitespace() {
// ?
}What is the idiomatic, single-lookup way to count word frequencies?
let mut counts: HashMap<&str, usize> = HashMap::new();
for w in text.split_whitespace() {
// ?
}