first
This commit is contained in:
commit
d72a5b20fc
11 changed files with 1106 additions and 0 deletions
22
src/day_1_2.rs
Normal file
22
src/day_1_2.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use std::env;
|
||||
use std::fs;
|
||||
use std::path::Iter;
|
||||
|
||||
pub fn solve_day_1_2() {
|
||||
// --snip--
|
||||
let file_path = "/home/clement/RustroverProjects/advent_of_code/src/inputs/input_1.txt";
|
||||
println!("In file {file_path}");
|
||||
|
||||
let (mut l_list, mut r_list) : (Vec<i32>, Vec<i32>) = fs::read_to_string(file_path)
|
||||
.expect("Should have been able to read the file")
|
||||
.split('\n')
|
||||
.map(|s|{
|
||||
let mut splited = s.split_whitespace();
|
||||
(
|
||||
splited.next().unwrap().parse::<i32>().unwrap(),
|
||||
splited.next().unwrap().parse::<i32>().unwrap()
|
||||
)
|
||||
}).unzip();
|
||||
|
||||
l_list.sort();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue