Merge pull request #47 from akshitgautam42/ex-47

ex 47
This commit is contained in:
Akshit Gautam 2023-11-28 20:55:25 +05:30 committed by GitHub
commit 7fb4acf21a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@
// Execute `rustlings hint hashmaps1` or use the `hint` watch subcommand for a
// hint.
// I AM NOT DONE
use std::collections::HashMap;

View File

@ -11,8 +11,7 @@
//
// Make me pass the tests!
//
// Execute `rustlings hint hashmaps2` or use the `hint` watch subcommand for a
// hint.
@ -46,6 +45,8 @@ fn fruit_basket(basket: &mut HashMap<Fruit, u32>) {
basket.insert(fruit,1);
}
}
// Calculate the total count of fruits
let total_count: u32 = basket.values().sum();
let total_count:u32 = basket.values().sum();
if total_count <=11{