feat: Added iterators5.rs exercise.

This commit is contained in:
apogeeoak
2021-02-10 18:03:29 -05:00
parent ab57c26cf9
commit b29ea17ea9
2 changed files with 128 additions and 0 deletions

View File

@@ -741,6 +741,21 @@ a mutable variable. Or, you might write code utilizing recursion
and a match clause. In Rust you can take another functional
approach, computing the factorial elegantly with ranges and iterators."""
[[exercises]]
name = "iterators5"
path = "exercises/standard_library_types/iterators5.rs"
mode = "test"
hint = """
The documentation for the std::iter::Iterator trait contains numerous methods
that would be helpful here.
Return 0 from count_stack to make the code compile in order to test count.
The stack variable in count_stack is a slice of HashMaps. It needs to be
converted into an iterator in order to use the iterator methods.
The fold method can be useful in the count_stack function."""
# THREADS
[[exercises]]