2023-12-05 12:36:28 -08:00
|
|
|
use std::fs::File;
|
|
|
|
use std::io::{BufRead, BufReader, Lines};
|
2023-12-12 02:24:24 -08:00
|
|
|
use std::time::{Duration, Instant};
|
2023-12-05 12:36:28 -08:00
|
|
|
|
|
|
|
// BOILERPLATE
|
|
|
|
type InputIter = Lines<BufReader<File>>;
|
|
|
|
|
|
|
|
fn get_input() -> InputIter {
|
|
|
|
let f = File::open("input").unwrap();
|
|
|
|
let br = BufReader::new(f);
|
|
|
|
br.lines()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2023-12-12 02:24:24 -08:00
|
|
|
let start = Instant::now();
|
|
|
|
let ans1 = problem1(get_input());
|
|
|
|
let duration = start.elapsed();
|
|
|
|
println!("Problem 1 solution: {} [{}s]", ans1, duration.as_secs_f64());
|
|
|
|
|
|
|
|
let start = Instant::now();
|
|
|
|
let ans2 = problem2(get_input());
|
|
|
|
let duration = start.elapsed();
|
|
|
|
println!("Problem 2 solution: {} [{}s]", ans2, duration.as_secs_f64());
|
2023-12-05 12:36:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
// PROBLEM 1 solution
|
|
|
|
|
2023-12-05 21:46:11 -08:00
|
|
|
fn problem1<T: BufRead>(input: Lines<T>) -> u64 {
|
2023-12-05 12:36:28 -08:00
|
|
|
0
|
|
|
|
}
|
|
|
|
|
|
|
|
// PROBLEM 2 solution
|
2023-12-05 21:46:11 -08:00
|
|
|
fn problem2<T: BufRead>(input: Lines<T>) -> u64 {
|
2023-12-05 12:36:28 -08:00
|
|
|
0
|
2023-12-07 20:56:08 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
use crate::*;
|
|
|
|
use std::io::Cursor;
|
|
|
|
|
|
|
|
const EXAMPLE: &str = &"";
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn problem1_example() {
|
|
|
|
let c = Cursor::new(EXAMPLE);
|
|
|
|
assert_eq!(problem1(c.lines()), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn problem2_example() {
|
|
|
|
let c = Cursor::new(EXAMPLE);
|
|
|
|
assert_eq!(problem2(c.lines()), 0);
|
|
|
|
}
|
|
|
|
}
|