We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ad2b65 commit b589d2aCopy full SHA for b589d2a
src/string/anagram.rs
@@ -57,13 +57,13 @@ fn clean_string(s: &str) -> Result<String, AnagramError> {
57
///
58
/// # Returns
59
60
-/// * A `HashMap` where the keys are characters and values are their frequencies.
+/// * A `HashMap` where the keys are characters and values are their count.
61
fn char_count(s: &str) -> HashMap<char, usize> {
62
- let mut freq = HashMap::new();
+ let mut res = HashMap::new();
63
for c in s.chars() {
64
- *freq.entry(c).or_insert(0) += 1;
+ *res.entry(c).or_insert(0) += 1;
65
}
66
- freq
+ res
67
68
69
#[cfg(test)]
0 commit comments