mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2025-09-01 04:50:39 +00:00
add rust
This commit is contained in:
10
2022/01/rust/main.rs
Normal file
10
2022/01/rust/main.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user