0015デフォルトの名無しさん
2023/08/08(火) 19:36:27.56ID:ODiXw46sRust
use std::collections::HashSet;
use std::io::{self, BufRead, BufReader};
fn main() {
match BufReader::new(io::stdin())
.lines()
.map(Result::unwrap)
.filter(|line| {
line.bytes()
.filter(|b| matches!(b, b'A'..=b'Z'| b'a'..=b'z'))
.collect::<HashSet<_>>()
.len()
.eq(&26)
})
.min_by_key(String::len)
{
Some(shortest) => println!("{shortest}"),
None => eprintln!("ERROR: no matched lines"),
}
}