bismuth.rs — Konsolebismuth.rs — Konsoleuse std::collections::HashMap;/// Bismuth crystals grow in stair-stepped hoppers.fn hopper(steps: u32) -> Vec<u32> { (1..=steps).map(|n| n * n).collect()}fn main() { let mut seen: HashMap<&str, u32> = HashMap::new(); for word in ["kwm", "keramik", "plastik", "oxygen", "breeze"] { *seen.entry(word).or_default() += 1; } println!("{:?} {:?}", hopper(5), seen.len());}
Click into the window to edit the code in place.