advent-of-code/2022/01/rust/main.rs

11 lines
252 B
Rust
Raw Normal View History

2023-11-18 16:45:50 +01:00
fn main() {
// Part A
let result: u32 = include_str!("../input.txt")
.trim()
.split("\n\n")
.map(|x| x.lines().map(|x| x.parse::<u32>().unwrap()).sum())
.max()
.unwrap();
println!("A: {}", result);
}