quest

Sign in to start training

quest keeps your progress, streaks, and scores tied to your account — so you can pick up on any device.

Synced everywhere. Progress follows you across laptop and phone.
Streaks & stats. See your daily run and every score over time.
Your profile. A name and avatar for the work you do here.

We only use Google to sign you in and sync progress. No posting, no contacts — ever.

Core Beginner

05  Collections

Work with the two collections you'll reach for most: find a maximum safely, then tally word frequencies.

Step 1 / 2

Return the largest element, or None if empty, in max.

Hints
  • Iterator has a built-in max(), and it already returns an Option.
  • A slice's iter() yields &i32; .copied() turns them into i32.
05_collections.rs
Reset to starterCompiled in a sandbox; hidden checks must pass.
Reveal solution
fn max(v: &[i32]) -> Option<i32> {
    v.iter().copied().max()
}