This commit is contained in:
Niccolo Borgioli 2023-11-18 16:45:50 +01:00
parent 14d00e16d5
commit 3af5af2461
No known key found for this signature in database
GPG Key ID: D93C615F75EE4F0B
4 changed files with 32 additions and 0 deletions

4
.gitignore vendored
View File

@ -2,3 +2,7 @@
node_modules
*.txt
.env*
# Added by cargo
/target

10
2022/01/rust/main.rs Normal file
View 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);
}

7
Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "advent-of-code"
version = "0.1.0"

11
Cargo.toml Normal file
View File

@ -0,0 +1,11 @@
[package]
name = "advent-of-code"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "2022-01"
path = "./2022/01/rust/main.rs"