Skip to content

Instantly share code, notes, and snippets.

@icub3d
Created January 29, 2026 20:09
Show Gist options
  • Select an option

  • Save icub3d/7fdb23e31d80312a7401ef642e19aa6e to your computer and use it in GitHub Desktop.

Select an option

Save icub3d/7fdb23e31d80312a7401ef642e19aa6e to your computer and use it in GitHub Desktop.
Kattis missingnumbers
use std::io::{Read, stdin};
fn main() {
let mut s = String::new();
stdin().read_to_string(&mut s).unwrap();
let nn = s.lines().skip(1).map(|n| n.parse::<usize>().unwrap());
let mut exp = 1;
let mut missed = false;
for n in nn {
while exp < n {
println!("{exp}");
exp += 1;
missed = true;
}
exp = n + 1;
}
if !missed {
println!("good job");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment