From 56bd3207db72231c96b81e28a37d11013a58c0fc Mon Sep 17 00:00:00 2001 From: Lennard Brinkhaus Date: Tue, 6 Dec 2022 17:12:36 +0100 Subject: [PATCH] feat: implement day06 and add test cases --- .fleet/run.json | 19 +++++++++++ src/day01.rs | 41 +++++++++++++++++++---- src/day02.rs | 50 +++++++++++++++++++++------- src/day03.rs | 69 ++++++++++++++++++++++++++------------- src/day04.rs | 51 +++++++++++++++++++++-------- src/day05.rs | 40 +++++++++++++++++++---- src/day06.rs | 56 +++++++++++++++++++++++++++++++ src/input/day01/example01 | 14 ++++++++ src/input/day02/example01 | 3 ++ src/input/day03/example01 | 6 ++++ src/input/day04/example01 | 6 ++++ src/input/day05/example01 | 9 +++++ src/input/day06/input01 | 1 + src/main.rs | 4 +++ 14 files changed, 308 insertions(+), 61 deletions(-) create mode 100644 .fleet/run.json create mode 100644 src/day06.rs create mode 100644 src/input/day01/example01 create mode 100644 src/input/day02/example01 create mode 100644 src/input/day03/example01 create mode 100644 src/input/day04/example01 create mode 100644 src/input/day05/example01 create mode 100644 src/input/day06/input01 diff --git a/.fleet/run.json b/.fleet/run.json new file mode 100644 index 0000000..5edcd1f --- /dev/null +++ b/.fleet/run.json @@ -0,0 +1,19 @@ +{ + "configurations": [ + { + "type": "cargo", + "name": "run-main", + "cargoArgs": ["run","--"] + }, + { + "type": "cargo", + "name": "build-dev", + "cargoArgs": ["build"] + }, + { + "type": "cargo", + "name": "build-release", + "cargoArgs": ["build", "--release"] + }, + ] +} \ No newline at end of file diff --git a/src/day01.rs b/src/day01.rs index 4b12700..9ff99f7 100644 --- a/src/day01.rs +++ b/src/day01.rs @@ -1,23 +1,32 @@ use crate::utils; pub fn execute_task01(content: &str) { - let vector = utils::convert_to_string_slice(&content); - let mut sum_vector = collect_all_calories(vector); - sum_vector.sort_by_key(|a| std::cmp::Reverse(*a)); - - let max: i32 = sum_vector[0]; + let max: i32 = solve_task01(content); println!("Day01 - Task01 - Biggest Calories {}", max) } + pub fn execute_task02(content: &str) { + let max_three: i32 = solve_task02(content); + + println!("Day01 - Task02 - Biggest Calories of top three: {}", max_three); +} + +fn solve_task01(content: &str) -> i32 { let vector = utils::convert_to_string_slice(&content); let mut sum_vector = collect_all_calories(vector); sum_vector.sort_by_key(|a| std::cmp::Reverse(*a)); - let max_three: i32 = sum_vector.iter().take(3).sum(); + sum_vector[0] +} - println!("Day01 - Task02 - Biggest Calories of top three: {}", max_three); +fn solve_task02(content: &str) -> i32 { + let vector = utils::convert_to_string_slice(&content); + let mut sum_vector = collect_all_calories(vector); + sum_vector.sort_by_key(|a| std::cmp::Reverse(*a)); + + sum_vector.iter().take(3).sum() } fn collect_all_calories(list: Vec<&str>) -> Vec { @@ -34,6 +43,24 @@ fn collect_all_calories(list: Vec<&str>) -> Vec { calories += var.parse::().unwrap_or(0); } + calories_list.push(calories); return calories_list; +} + +#[cfg(test)] +mod test { + + const EXAMPLE01: &'static str = include_str!("input/day01/example01"); + + + #[test] + fn test_first() { + assert_eq!(super::solve_task01(EXAMPLE01), 24000); + } + + #[test] + fn test_second() { + assert_eq!(super::solve_task02(EXAMPLE01), 45000); + } } \ No newline at end of file diff --git a/src/day02.rs b/src/day02.rs index df404d5..37e8143 100644 --- a/src/day02.rs +++ b/src/day02.rs @@ -34,30 +34,38 @@ enum Move { } pub fn execute_task01(content: &str) { - let vector = utils::convert_to_string_slice(&content); - let score: i32 = vector.into_iter().map(|line| { - let opp_char: char = line.chars().nth(0).unwrap(); - let you_char: char = line.chars().nth(2).unwrap(); - - calculate_score_from_game(&convert_to_move(opp_char), &convert_to_move(you_char)) - }).sum(); + let score = solve_task01(content); println!("Day02 - Task01 - Score: {}", score); } pub fn execute_task02(content: &str) { + let score = solve_task02(content); + + println!("Day02 - Task01 - Score: {}", score); + +} + +fn solve_task01(content: &str) -> i32 { let vector = utils::convert_to_string_slice(&content); - let score: i32 = vector.into_iter().map(|line| { + vector.into_iter().map(|line| { + let opp_char: char = line.chars().nth(0).unwrap(); + let you_char: char = line.chars().nth(2).unwrap(); + + calculate_score_from_game(&convert_to_move(opp_char), &convert_to_move(you_char)) + }).sum() +} + +fn solve_task02(content: &str) -> i32 { + let vector = utils::convert_to_string_slice(&content); + vector.into_iter().map(|line| { let opp_char: char = line.chars().nth(0).unwrap(); let you_char: char = line.chars().nth(2).unwrap(); let opp_move: Move = convert_to_move(opp_char); calculate_score_from_game(&opp_move, &convert_to_conditional_move(&opp_move ,you_char)) - }).sum(); - - println!("Day02 - Task01 - Score: {}", score); - + }).sum() } fn convert_to_conditional_move(opp: &Move, you: char) -> Move { @@ -94,4 +102,22 @@ fn calculate_score_from_game(opp: &Move, you: &Move) -> i32 { (Scissors, Paper) => 0 + 2, // You Lose with Paper (Scissors, Scissors) => 3 + 3, // You Draw with Scissors } +} + + +#[cfg(test)] +mod test { + + const EXAMPLE01: &'static str = include_str!("input/day02/example01"); + + + #[test] + fn test_first() { + assert_eq!(super::solve_task01(EXAMPLE01), 15); + } + + #[test] + fn test_second() { + assert_eq!(super::solve_task02(EXAMPLE01), 12); + } } \ No newline at end of file diff --git a/src/day03.rs b/src/day03.rs index fa43ea9..6c82367 100644 --- a/src/day03.rs +++ b/src/day03.rs @@ -1,23 +1,33 @@ use crate::utils; pub fn execute_task01(content: &str) { - let vector = utils::convert_to_string_slice(&content); - let rucksack_compartments: Vec<(Vec, Vec)> = vector.iter().map(|line| split_rucksack_in_two_compartments(line)).collect(); - - let duplicates: Vec = rucksack_compartments.iter() - .flat_map(|(vec1, vec2)| vec1.iter() - .copied() - .flat_map(|entry| vec2.iter().copied().map(move |b| (entry, b))) - .filter(|(a, b)| a == b) - .map(|(a, _)| a)) - .collect(); - - let sum: i32 = duplicates.iter().copied().map(|c| convert_char_to_prio(&c)).sum(); + let sum = solve_task01(content); println!("Day03 - Task01 - Sum of Priorities: {}", sum); } pub fn execute_task02(content: &str) { + let sum = solve_task02(content); + + println!("Day03 - Task02 - Sum of Groups of Priorities: {}", sum); +} + +fn solve_task01(content: &str) -> i32 { + let vector = utils::convert_to_string_slice(&content); + let rucksack_compartments: Vec<(Vec, Vec)> = vector.iter().map(|line| split_rucksack_in_two_compartments(line)).collect(); + + let duplicates: Vec = rucksack_compartments.iter() + .flat_map(|(vec1, vec2)| vec1.iter() + .copied() + .flat_map(|entry| vec2.iter().copied().map(move |b| (entry, b))) + .filter(|(a, b)| a == b) + .map(|(a, _)| a)) + .collect(); + + duplicates.iter().copied().map(|c| convert_char_to_prio(&c)).sum() +} + +fn solve_task02(content: &str) -> i32 { let vector = utils::convert_to_string_slice(&content); let compartments: Vec> = vector.iter().map(|line| split_rucksack_in_items(line)).collect(); let mut duplicates: Vec = vec![]; @@ -32,20 +42,18 @@ pub fn execute_task02(content: &str) { let third_vec = compartments.get(third_index).expect("ERR"); let mut dups: Vec = first_vec.into_iter() - .copied() - .flat_map(|val1| second_vec.into_iter() - .copied() - .flat_map(move |val2| third_vec.into_iter().copied().map(move |val3| (val1, val2, val3)))) - .filter(|(a, b, c)| a == b && b == c) - .map(|(a, _, _)| a) - .collect(); + .copied() + .flat_map(|val1| second_vec.into_iter() + .copied() + .flat_map(move |val2| third_vec.into_iter().copied().map(move |val3| (val1, val2, val3)))) + .filter(|(a, b, c)| a == b && b == c) + .map(|(a, _, _)| a) + .collect(); duplicates.append(&mut dups) } - let sum: i32 = duplicates.iter().copied().map(|c| convert_char_to_prio(&c)).sum(); - - println!("Day03 - Task02 - Sum of Groups of Priorities: {}", sum); + duplicates.iter().copied().map(|c| convert_char_to_prio(&c)).sum() } fn split_rucksack_in_two_compartments(rucksack_content: &str) -> (Vec, Vec) { @@ -84,4 +92,21 @@ pub fn convert_char_to_prio(c: &char) -> i32 { } panic!("never should called"); +} + +#[cfg(test)] +mod test { + + const EXAMPLE01: &'static str = include_str!("input/day03/example01"); + + + #[test] + fn test_first() { + assert_eq!(super::solve_task01(EXAMPLE01), 157); + } + + #[test] + fn test_second() { + assert_eq!(super::solve_task02(EXAMPLE01), 70); + } } \ No newline at end of file diff --git a/src/day04.rs b/src/day04.rs index a3094c2..e24bf52 100644 --- a/src/day04.rs +++ b/src/day04.rs @@ -1,29 +1,36 @@ use crate::utils; pub fn execute_task01(content: &str) { - let vector = utils::convert_to_string_slice(&content); - let pairs: Vec<((i32, i32), (i32, i32))> = vector.iter().map(|line| convert_to_tuple(line)).collect(); + let sum: usize = solve_task01(content); - let fully_pairs: usize = pairs - .into_iter() - .filter(|pair| is_fully_in_other(pair.0, pair.1)) - .count(); - - println!("Day04 - Task01 - Sum of fully included pairs: {}", fully_pairs); + println!("Day04 - Task01 - Sum of fully included pairs: {}", sum); } pub fn execute_task02(content: &str) { + let sum: usize = solve_task02(content); + + println!("Day04 - Task02 - Sum of partial included pairs: {}", sum); +} + +fn solve_task01(content: &str) -> usize { let vector = utils::convert_to_string_slice(&content); let pairs: Vec<((i32, i32), (i32, i32))> = vector.iter().map(|line| convert_to_tuple(line)).collect(); - let fully_pairs: usize = pairs - .into_iter() - .filter(|pair| is_partial_in_other(pair.0, pair.1)) - .count(); - - println!("Day04 - Task02 - Sum of partial included pairs: {}", fully_pairs); + pairs + .into_iter() + .filter(|pair| is_fully_in_other(pair.0, pair.1)) + .count() } +fn solve_task02(content: &str) -> usize { + let vector = utils::convert_to_string_slice(&content); + let pairs: Vec<((i32, i32), (i32, i32))> = vector.iter().map(|line| convert_to_tuple(line)).collect(); + + pairs + .into_iter() + .filter(|pair| is_partial_in_other(pair.0, pair.1)) + .count() +} fn convert_to_tuple(line: &str) -> ((i32, i32), (i32, i32)) { let pairs: Vec<(i32, i32)> = line @@ -61,3 +68,19 @@ fn is_partial_in_other(first: (i32, i32), second: (i32, i32)) -> bool { return false } +#[cfg(test)] +mod test { + + const EXAMPLE01: &'static str = include_str!("input/day04/example01"); + + + #[test] + fn test_first() { + assert_eq!(super::solve_task01(EXAMPLE01), 2); + } + + #[test] + fn test_second() { + assert_eq!(super::solve_task02(EXAMPLE01), 4); + } +} \ No newline at end of file diff --git a/src/day05.rs b/src/day05.rs index ced7c76..1252102 100644 --- a/src/day05.rs +++ b/src/day05.rs @@ -5,6 +5,18 @@ use crate::utils; use regex::Regex; pub fn execute_task01(content: &str) { + let line = solve_task01(content); + + println!("Day05 - Task01 - Last Item Str Line: {}", line); +} + +pub fn execute_task02(content: &str) { + let line = solve_task02(content); + + println!("Day05 - Task02 - Last Item Str Line: {}", line); +} + +fn solve_task01(content: &str) -> String { let re = Regex::new(r"move (\d+) from (\d+) to (\d+)").unwrap(); let mut setup: Vec<&str> = vec![]; @@ -33,12 +45,10 @@ pub fn execute_task01(content: &str) { }); let str_line_vec: Vec = port.into_iter().map(|vec| vec.into_iter().last().unwrap().trim().replace("[", "").replace("]", "")).collect(); - - println!("Day05 - Task01 - Last Item Str Line: {}", str_line_vec.join("")); - + str_line_vec.join("") } -pub fn execute_task02(content: &str) { +fn solve_task02(content: &str) -> String { let re = Regex::new(r"move (\d+) from (\d+) to (\d+)").unwrap(); let mut setup: Vec<&str> = vec![]; @@ -68,10 +78,10 @@ pub fn execute_task02(content: &str) { let str_line_vec: Vec = port.into_iter().map(|vec| vec.into_iter().last().unwrap().trim().replace("[", "").replace("]", "")).collect(); - println!("Day05 - Task02 - Last Item Str Line: {}", str_line_vec.join("")); - + str_line_vec.join("") } + fn move_in_port(mut port: &mut Vec>, from: &str, to: &str, size: i32) { for _ in 0..size { move_in_port_once(&mut port, from, to) @@ -123,4 +133,22 @@ fn parse_port_level(line: &str) -> Vec { .chunks(4) .map(|c| c.iter().collect::()) .collect() +} + + +#[cfg(test)] +mod test { + + const EXAMPLE01: &'static str = include_str!("input/day05/example01"); + + + #[test] + fn test_first() { + assert_eq!(super::solve_task01(EXAMPLE01), "CMZ"); + } + +#[test] +fn test_second() { + assert_eq!(super::solve_task02(EXAMPLE01), "MCD"); + } } \ No newline at end of file diff --git a/src/day06.rs b/src/day06.rs new file mode 100644 index 0000000..5879d56 --- /dev/null +++ b/src/day06.rs @@ -0,0 +1,56 @@ +use std::collections::HashSet; + +pub fn execute_task01(content: &str) { + let index = solve_task01(content); + + println!("Day06 - Task01 - First code start at: {}", index); +} + +pub fn execute_task02(content: &str) { + let index = solve_task02(content); + + println!("Day06 - Task02 - First code start at: {}", index); +} + +fn solve_task01(content: &str) -> usize { + find_code(content, 4) +} + +fn solve_task02(content: &str) -> usize { + find_code(content, 14) +} + +fn find_code(content: &str, len: usize) -> usize { + content + .as_bytes() + .windows(len) + .enumerate() + .filter(|(_, part)| { + let mut used = HashSet::new(); + part.iter().all(move |elt| used.insert(elt)) + }) + .map(|(i, _)| i + len) + .next().unwrap() +} + + +#[cfg(test)] +mod test { + + #[test] + fn test_first() { + assert_eq!(super::solve_task01("bvwbjplbgvbhsrlpgdmjqwftvncz"), 5); + assert_eq!(super::solve_task01("nppdvjthqldpwncqszvftbrmjlhg"), 6); + assert_eq!(super::solve_task01("nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg"), 10); + assert_eq!(super::solve_task01("zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw"), 11); + } + + #[test] + fn test_second() { + assert_eq!(super::solve_task02("mjqjpqmgbljsphdztnvjfqwrcgsmlb"), 19); + assert_eq!(super::solve_task02("bvwbjplbgvbhsrlpgdmjqwftvncz"), 23); + assert_eq!(super::solve_task02("nppdvjthqldpwncqszvftbrmjlhg"), 23); + assert_eq!(super::solve_task02("nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg"), 29); + assert_eq!(super::solve_task02("zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw"), 26); + } +} \ No newline at end of file diff --git a/src/input/day01/example01 b/src/input/day01/example01 new file mode 100644 index 0000000..444e241 --- /dev/null +++ b/src/input/day01/example01 @@ -0,0 +1,14 @@ +1000 +2000 +3000 + +4000 + +5000 +6000 + +7000 +8000 +9000 + +10000 \ No newline at end of file diff --git a/src/input/day02/example01 b/src/input/day02/example01 new file mode 100644 index 0000000..25097e8 --- /dev/null +++ b/src/input/day02/example01 @@ -0,0 +1,3 @@ +A Y +B X +C Z \ No newline at end of file diff --git a/src/input/day03/example01 b/src/input/day03/example01 new file mode 100644 index 0000000..9919ffa --- /dev/null +++ b/src/input/day03/example01 @@ -0,0 +1,6 @@ +vJrwpWtwJgWrhcsFMMfFFhFp +jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL +PmmdzqPrVvPwwTWBwg +wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn +ttgJtRGJQctTZtZT +CrZsJsPPZsGzwwsLwLmpwMDw \ No newline at end of file diff --git a/src/input/day04/example01 b/src/input/day04/example01 new file mode 100644 index 0000000..99a66c5 --- /dev/null +++ b/src/input/day04/example01 @@ -0,0 +1,6 @@ +2-4,6-8 +2-3,4-5 +5-7,7-9 +2-8,3-7 +6-6,4-6 +2-6,4-8 \ No newline at end of file diff --git a/src/input/day05/example01 b/src/input/day05/example01 new file mode 100644 index 0000000..c526f15 --- /dev/null +++ b/src/input/day05/example01 @@ -0,0 +1,9 @@ + [D] +[N] [C] +[Z] [M] [P] + 1 2 3 + +move 1 from 2 to 1 +move 3 from 1 to 3 +move 2 from 2 to 1 +move 1 from 1 to 2 \ No newline at end of file diff --git a/src/input/day06/input01 b/src/input/day06/input01 new file mode 100644 index 0000000..f905114 --- /dev/null +++ b/src/input/day06/input01 @@ -0,0 +1 @@ +sgrrrrwcrrlqqgppfgfnngsgcgngrrllnqnndzzjgzzzjdjqdjdhhjshjhwwqnnwjnwnjwjttvgvddjrrtvtsvtvqtqhhbchcdhhnwwvqvvsbsqswqqdwdjwwjvvrddgpdpdlpljjwffqnffbllplmmwzwtzzvfzvvjbbmnmppzgzszllsqqpvqvmmzzlccjhchdhlddchdchcddnwdwhhhczzldlsdlssdmmswswzwtwzwjzwzfwwdhwdwjdjldjldlqddhttfbfnbfnfgnfnvnffsszjjsqqdzdsdrsswddggstgsgqgzqgqcqdccqcvcpcspccdgccfflppddqfdfmdffmlflplnppfvvgsgbgtgccmfccfwwthhcjcbbhbwbjbhjjtddrldlrddzjdzdttbfbmmtjmjtjzjvjvgvttthwhhgqhggcbbtqbbqgbqqvccdttfgfwfnwffbfqbfbbnlnzlzbbwnwntwtjwjnjwwsdwwcbbwhwzwhwvhhpwwnvvtvnttgtrrnjjzppmbmfmjffdddvfvjjpfpgpzzwqwpwllwjjzmjmdmdwwdrdttpmmdhdndvvpbpqbbzqzmmtdmmtddlccjvjsjrsscqqzvvbsstccvffcttwrwjjsgsttmgmvvzbbcjbjrbrddvjjnhjhphvhsszqqfrfzfssgfssgddcbbplbbsfsmfmpphssmvvcvrrcgrcgcvggrzggzjjfhjjtpphzppqtptllssbmbrrgrvvhjjnznlnggrnrsnrrphhbqhhhsthsthhhnssmsjjwjppqfqlqqgnnhnmmfsfslfllvnnsdnssgngbbjmjccsrrmjjnljlwlttpffddgbdggmbgbtbzzwgwppczcffvccnssbmmjrrfwwhcwhwqwnqqzsqqjsqqnndqdgqdqgggzjjcvvzdddhnhjnnzlnlwlzlqqvjjpprqrjrfjjrpjjnfntffqtttnjjdbjbdjbbrsrbbmrmccpllmccqrqwqnnsjjmjgjqjpqjqgjjtwwqdqmqtqqmsqmmvlldtllbcctfcccdcddcggmmmsggjddcqddbqqdgqgffststgtftbbdrbrlllnvllcflfpfdffjvvvmdmvvtfvfcvvfgghzzlgzgszzhmzzhfhllgblggfpfzfvzvdzzhsspmmjtjhjggfhggnggbtggqqtztqtmqtqddmzmrmdrmdmqqcbqcqzzvczvzfvvsggcgssjnnjqnntwtmwwhzzzhllqvlljsljjfnnjwjnwnffpggqwwvbwwdbbmbvmvlvnnnppqvqqghqgqppnllhjllvlflfpfhfjjhgjgpjpbjjdpdqdpqdpdwpwffqlffrbrjrtrvtvrtvrtrvtvltlrrvjjlttmtffhvfhfnhnlnfnvvltvlvlbbfllfnllndndcdrrnznssvpvhhhmrmlmhhrnhhpggtftddghhqrqddjttbdbqddpsdppwrwhhhgwhhqrhqrqhhqdhqddjpjqqsdsmddnqncqnqwqdwwhghbhffnsffnsszlssntnbbbfhbhwhzhdzhzbhblbzzzbqzbbgtbbcjbjtjptpwwhlwwhhmshhmbbfjbfflnnlmnnzvnnbtnbbvwvvgcggrzrffwmwhmwhwjwpwwzbbvtbtssdhdlhhdppmmcnmcmffnpfffvbfvfhvhjhffzfbzzfdfpdpzzhbzblbbmffvvcmmttdntnmtmztzbbncbctcqtcqqcvcfcwcdcchphfhjhhjbjnjtjnjwwzsstpprnnhtntvtpthpttpdpzzwcczsscqscsbbmpbbdsdlsslzszjszsczntrqjmmmfqsdwtqqflgsttwfqqvvspnlfvqlrvvbjmmpmttcdnhncmmdfhwwqdrqjqwggrbtgbrdmmrhhvqfvvhsmtfbnthrbltgvdrsbqglgjqtssbvmbjjjbbcgfftgbjmfqzggdtcfzddqlrvwqjjvnmjzjwqrwsqbjgnswpnlbdzdlcvcbqplzgqwmsntzzjhqwfjdprglcccnldfqftgttqbrmclsqtncrjbttcglcvspsgvdjqgrdzzlnhbfqbwnfqcjrrqpprjbqpzhthgsgcflqldsnwsvzgcmfrdvfmqhbcfczhschpwnmdjnjlvrwqllnnhjvjtzhcrqcwlmrqfdhvzcbnvwrgngttwlhcmmgtzwjztscjnmslbvtdrvgdprlfrhggcwtwjhblppfbpljbmwrlwqrfwjwfsftmflsdfrhlvgcbzcvhlhgclvnmtfcqttvcphgvflhdclbmtgsrldgfvtpjcphtzdctrcchwdbdbtpptdnbjnqwdrllmnbcgfltmggpqfbfpmnhcmpgsgptflglzswtmrjfzmwmwphfjngnfmmtqlrsltlvlfmwmjvvtgngllszwzdjjmbnwwgzpqltlrzfdwchgttvlhgjjhjqmlrrwsqlhsgzsgmmsgbgvrlmbprrhlgsjnsdwcbrwvqjqmfcqcwllsvggcznwpzvgpszrqwngcnchvdlrdrgtbsjdqfpsfvwdtdlqwbfjlwrmqbrhwqmfgppwvfbgthnbqnmqqhmpfwbgljcmqqbpnwvztrcrlbvtcnncwwjcbqsmbqnqtrmpwmhlvwtfmsmtpfnmphqdvqfzvmjjhnwdfjnwvmbbwvthhwzjtzzrsmqlqtnnrqjrnchqttgsptfpdcpgfmzvqhwffqmfhwqqbdhmgcrfqtwrcgtgmglmmwhvqwvglfsvwbpvhmnbqhgfgqwwnhdhvnwggsmhjfsjmsrlcvlnhrhrlhbvhdrhbplrzspdmbcnzbwlvcmztwvghlsnzmbnrpssrngpdtmgzfcbqmfdgthcscjspspmcgdmwwwfspgjwzccrfzdpbwrfpgpgzrchffmhvwwppbjwqmdzgtpfmcblzqrghzdbzqzvbnmqbdlzjrwbbhqgtdzntgdbndmndhlnhcvqtlfcrfprfrlfglwvdnszrwjdcmtstcsnvnpcldctvqpcfhjnpvscscrtfqfjcrjlrmcqjfthptbqprbvchjlqzmfcmlhmfmdhhpcqbncmcqjsdmzflwtzfdcgmrbwbcdgjmfhlshsbwmbdcbfbvmqcgwlqpprjfrhzvsjmcjdfnwhcffhtnqpznfzpttsqqwcsvpdhdfbggzpngvbvdlpmvfjjlcfmbvmfqsczprtlnwvqnnlcrdnvpmcbrzvlfgscbcwtrbcpdnpshhmrqmhnwcndptljhwpvtcflqgmzjsfmfdzwwwhnbpzjwzgqmdcdbtfhwtgvcscbdqlcmppwjgghvrmqpwfbnjfhfcrccfzjvtjsjcsmhncdjlclvhfsvlcjcnpbqqqdjmjdbggmfwswvdjscvgrdbpcrcqtndswgdnznzpwtcdgvcrrqpdcpbmbdjrsgnfvgwpgpzttfmsczcmjvhmdpbpmjjcjsvbvbwjpwtwpsdddlsnvrshqvmwsjwwvqnczzljjfptcszgpndgczprbvjbnqpwgzmnlhvbsfbtjnwbtlzqgnmzbmqgqvwzltvqczfpdzfzsfhqlmtfcbfdqtnwzbvqblqmzvmnspntqtqdglrdmdntrghwvpfrbjgpzvrnppvnvfgwdzlvhtcscclbtftlvsprwhjvjlhrhfdgzbfbfphzbhtfdlpzcshhfzhtdvggnnbqvnrwvnhvgjgjpcrztqjmtzlzlrlmndfvctzjdpnmlgmsppqdrzmptvrsptvmmbvbwvhwptrtlfdqdqwfgldtbhqdhszcmwqnhswrdhgmgvbvbhwhlpcflsrwlvsvhvctmwwhtlgmshdqflwsdjbbzgbvbwpfncgqjzfjvmzzhgdzjvghtrtsmwgzpdrngwdbtfzrqsgdmwtdhsftfqcnmjtrqqwthcbgtmqnjvjzzplrzllnjqddvbwnglhtzljwjvscdfdnsvmrgwhjrhlrqpqgmzstnwwjpddhdbsnnsqvtsdhtmfdmbcpzwqmbhhjhcfzbvvglhfdltrmbstjhsqrbs \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 8d6f015..58897c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,12 +4,14 @@ mod day02; mod day03; mod day04; mod day05; +mod day06; const CONTENT01: &'static str = include_str!("input/day01/input01"); const CONTENT02: &'static str = include_str!("input/day02/input01"); const CONTENT03: &'static str = include_str!("input/day03/input01"); const CONTENT04: &'static str = include_str!("input/day04/input01"); const CONTENT05: &'static str = include_str!("input/day05/input01"); +const CONTENT06: &'static str = include_str!("input/day06/input01"); fn main() { day01::execute_task01(&CONTENT01); @@ -27,4 +29,6 @@ fn main() { day05::execute_task01(&CONTENT05); day05::execute_task02(&CONTENT05); + day06::execute_task01(&CONTENT06); + day06::execute_task02(&CONTENT06); }