feat: Add hashmap3 exercise.

This commit is contained in:
Sateesh Basavaraju
2021-06-04 16:09:12 +05:30
committed by mokou
parent fe54d0f85b
commit 1e54bc61e8
2 changed files with 100 additions and 0 deletions

View File

@@ -506,6 +506,18 @@ Use the `entry()` and `or_insert()` methods of `HashMap` to achieve this.
Learn more at https://doc.rust-lang.org/stable/book/ch08-03-hash-maps.html#only-inserting-a-value-if-the-key-has-no-value
"""
[[exercises]]
name = "hashmaps3"
path = "exercises/hashmaps/hashmaps3.rs"
mode = "test"
hint = """
Hint 1: Use the `entry()` and `or_insert()` methods of `HashMap` to insert entries corresponding to each team in the scores table.
Learn more at https://doc.rust-lang.org/stable/book/ch08-03-hash-maps.html#only-inserting-a-value-if-the-key-has-no-value
Hint 2: If there is already an entry for a given key, the value returned by `entry()` can be updated based on the existing value.
Learn more at https://doc.rust-lang.org/book/ch08-03-hash-maps.html#updating-a-value-based-on-the-old-value
"""
# TEST 2
[[exercises]]