From 3093615013d7f3221d9a5fb92089f6b0af328bb3 Mon Sep 17 00:00:00 2001 From: akshitgautam42 Date: Tue, 28 Nov 2023 20:53:51 +0530 Subject: [PATCH] ex 47 --- exercises/11_hashmaps/hashmaps1.rs | 2 +- exercises/11_hashmaps/hashmaps2.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/exercises/11_hashmaps/hashmaps1.rs b/exercises/11_hashmaps/hashmaps1.rs index 09522dfe..a3ab0160 100644 --- a/exercises/11_hashmaps/hashmaps1.rs +++ b/exercises/11_hashmaps/hashmaps1.rs @@ -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; diff --git a/exercises/11_hashmaps/hashmaps2.rs b/exercises/11_hashmaps/hashmaps2.rs index 8a44b1eb..a2baa17f 100644 --- a/exercises/11_hashmaps/hashmaps2.rs +++ b/exercises/11_hashmaps/hashmaps2.rs @@ -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) { 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{