Compare commits
3 Commits
2e5044e0ff
...
b1a4c31c65
| Author | SHA1 | Date | |
|---|---|---|---|
| b1a4c31c65 | |||
| 0fc1789a90 | |||
| a38d6cc7eb |
@@ -1,3 +1,7 @@
|
|||||||
|
//https://adventofcode.com/2024/day/1
|
||||||
|
//
|
||||||
|
// run command: `cargo run ./input.txt`
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
@@ -96,11 +100,11 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"Difference: {}",
|
"Difference (part 1): {}",
|
||||||
calculate_diff(left_list.clone(), right_list.clone())
|
calculate_diff(left_list.clone(), right_list.clone())
|
||||||
);
|
);
|
||||||
println!(
|
println!(
|
||||||
"Similarity: {}",
|
"Similarity (part 2): {}",
|
||||||
calculate_similarity(left_list, right_list)
|
calculate_similarity(left_list, right_list)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
6
day_02/Cargo.toml
Normal file
6
day_02/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "day_02"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
3
day_02/src/main.rs
Normal file
3
day_02/src/main.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user