|
|
@ -12,10 +12,10 @@ fn max_char(chars: &str) -> (char, usize)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mut map = Map::new();
|
|
|
|
let mut map = Map::new();
|
|
|
|
for x in chars.chars() {
|
|
|
|
for x in chars.chars() {
|
|
|
|
*map.entry(x).or_insert(0usize) += 1;
|
|
|
|
*map.entry(x).or_insert(0usize) += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
map.into_iter().max_by_key(|(k, v)| v).unwrap_or_default()
|
|
|
|
map.into_iter().max_by_key(|&(_, v)| v).unwrap_or_default()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|