Skip to content
← All Rust tracks

Collections, Text and First Iterators

Rust

Work with vectors, maps and strings. Choose collection operations, handle UTF-8 text, and use iterators to process values.

This track uses Rust. You can make it your practice mode to browse related content across the site.

19 exercises

2 articles

Explore freely. Sign in to keep your progress.

Your learning sequence

  1. 1 Not solved yet. Vec surgery: retain, dedup and extract_if Practice · Medium
  2. 2 Capacity, amortisation, and reusing Rust buffers Read
  3. 3 Not solved yet. Build a CSV record with one output buffer Practice · Easy
  4. 4 Not solved yet. Joining owned strings Practice · Easy
  5. 5 Not solved yet. ASCII search without lowercase copies Practice · Easy
  6. 6 Not solved yet. Zero-copy parsing: borrow, don't allocate Practice · Medium
  7. 7 Not solved yet. Look up and update HashMap values Practice · Easy
  8. 8 Not solved yet. Group and count words with BTreeMap entries Practice · Medium
  9. 9 Not solved yet. HashMap iteration order is random Practice · Medium
  10. 10 Not solved yet. BTreeMap range queries Practice · Medium
  11. 11 Not solved yet. Set algebra with BTreeSet Practice · Easy
  12. 12 Not solved yet. VecDeque and breadth-first search Practice · Easy
  13. 13 Not solved yet. BinaryHeap is a max-heap, and Reverse is the fix Practice · Medium
  14. 14 Choosing a Rust collection by the work it does Read
  15. 15 Not solved yet. Group anagrams with a map Practice · Medium
  16. 16 Not solved yet. windows and chunks are slice methods, not iterator adapters Practice · Medium
  17. 17 Not solved yet. Cow: borrow until you have to own Practice · Medium
  18. 18 Not solved yet. Cow in API design: impl Into<Cow<str>> Practice · Hard
  19. 19 Not solved yet. Remove and return matching events with extract_if Practice · Easy
  20. 20 Not solved yet. Reusing buffers instead of allocating per iteration Practice · Medium
  21. 21 Not solved yet. Collect sorted keys and build a last-value index Practice · Easy

Check yourself

3 questions · not saved while you're signed out

Use these questions to check your understanding and compare explanations. Your score does not affect track completion.

0 / 3 correct

What do len() and chars().count() report for this string?

Choose one answer to reveal the explanations. Answers are kept only while this page is open.

fn main() {
    let s = String::from("héllo");
    println!("{} {}", s.len(), s.chars().count());
}
Question 1 of 3