add 01, 02

This commit is contained in:
timeshifter
2024-01-31 14:25:08 +01:00
parent aae899c552
commit d49022f310
14 changed files with 1426 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aoc"
version = "0.1.0"
+8
View File
@@ -0,0 +1,8 @@
[package]
name = "aoc"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
+8
View File
@@ -0,0 +1,8 @@
use std::{fs, io::Read};
pub fn read_file(filename: &str) -> Vec<String> {
let mut f = fs::File::open(filename).unwrap();
let mut buffer = String::new();
f.read_to_string(&mut buffer).unwrap();
buffer.lines().map(|s| s.to_owned()).collect()
}