mirror of https://github.com/01-edu/public.git
feat(simple_hash): rewrite exercise completely
improve the way students are introduced to hash maps
This commit is contained in:
parent
6e969f8b3f
commit
9425070b2e
|
@ -6,14 +6,14 @@ Create a **function** named `word_frequency_counter` which will receive a vector
|
||||||
|
|
||||||
Also create a function named `nb_distinct_words` which will take a reference to the `HashMap` and return the number of distinct words present in it.
|
Also create a function named `nb_distinct_words` which will take a reference to the `HashMap` and return the number of distinct words present in it.
|
||||||
|
|
||||||
|
> all the words tested will be lowercase
|
||||||
|
|
||||||
### Expected functions
|
### Expected functions
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
pub fn word_frequency_counter(words: Vec<&str>) -> HashMap<&str, usize> {}
|
pub fn word_frequency_counter(words: Vec<&str>) -> HashMap<&str, usize> {}
|
||||||
|
|
||||||
pub fn nb_distinct_words(frequency_count: &HashMap<&str, usize>) -> usize {
|
pub fn nb_distinct_words(frequency_count: &HashMap<&str, usize>) -> usize {}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
Loading…
Reference in New Issue