Compare commits
3 commits
1c5e2b26e5
...
0db7712260
Author | SHA1 | Date | |
---|---|---|---|
0db7712260 | |||
92306ca539 | |||
ffe2432af5 |
3 changed files with 357 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
name = "aoc-vv"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
default-run = "p02"
|
||||
default-run = "p03"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
300
etc/p03.txt
Normal file
300
etc/p03.txt
Normal file
|
@ -0,0 +1,300 @@
|
|||
RCMRQjLLWGTjnlnZwwnZJRZH
|
||||
qnvfhpSbvSppNddNdSqbbmmdPrwttJVrVPDVrJtHtwPZhrPJ
|
||||
BFpFzSSqSFFSvQsnWgCMjTLzng
|
||||
DbWVcVRRdlLffvtqjTWNgQ
|
||||
mJJMpsmrMrJSHJpsHrFHvBvgHvqfNvzffgTvfj
|
||||
mMhPjmjmFPJhMSGGcDRlwRdcLGPc
|
||||
qFcbmWFJqqWpRJcQWpqsQQQwSPCPrHRHCPdNZtSrSHwrNZ
|
||||
jGMjGLhhhgTvghgtGVjnNCrPVwZSZffSNSwHZZdH
|
||||
DvzDlvvhnjlMlglglGGhDLpqqcJWWtsmszpWbBBBmQmb
|
||||
SPLPHQbJSbPsvTLmfDvVDctvWhcDlD
|
||||
jdRRzzGgJqwrpMRMgdjlcVcWqfWWlfDlmmlWhB
|
||||
rwgRGdpGprNNLQLsbZJPsn
|
||||
GZhTVLztHrSzrRBz
|
||||
MJWjMvsfSCLSnrJn
|
||||
MjglcgWMdccvZGFtTDchLLLh
|
||||
rgDHBgBjRgRTgwzwthBnQwmBtB
|
||||
MsMpSfMsTGTFFLdFFFMFsnNmthNnzhthtwmWnznz
|
||||
pZMpJdvJMGRHVJJTVHjb
|
||||
TQVqZVBcBBdBfbpN
|
||||
zvzrtCshrntCHslPMMMFpZHbNSpb
|
||||
hLWhGLttsvLvrrWvhzVmQgwJZTRcgg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||||
bSSgGFWDgWwDFFlmWlcShqdpRqpVcHvvnqpvpRHd
|
||||
bGFnGljgSsjBCTBszz
|
56
src/bin/p03.rs
Normal file
56
src/bin/p03.rs
Normal file
|
@ -0,0 +1,56 @@
|
|||
#![feature(iterator_try_collect)]
|
||||
|
||||
use std::fs;
|
||||
use std::io::{self, BufRead};
|
||||
use std::collections::HashSet;
|
||||
|
||||
|
||||
fn main() {
|
||||
let filename = "etc/p03.txt";
|
||||
let file = fs::File::open(filename).expect("Can't open file");
|
||||
let reader = io::BufReader::new(file);
|
||||
|
||||
println!("PART ONE ---------------");
|
||||
let lines: Vec<String> = reader.lines().try_collect().expect("Expected all lines to be valid");
|
||||
part1(&lines);
|
||||
|
||||
println!("\n PART TWO ---------------");
|
||||
part2(&lines);
|
||||
}
|
||||
|
||||
fn to_priority(c: char) -> Result<u32, &'static str> {
|
||||
if c.is_ascii_uppercase() {
|
||||
Ok(c as u32 - 'A' as u32 + 26 + 1)
|
||||
} else if c.is_ascii_lowercase() {
|
||||
Ok(c as u32 - 'a' as u32 + 1)
|
||||
} else {
|
||||
Err("Can't convert non-alphanumeric")
|
||||
}
|
||||
}
|
||||
|
||||
fn part1(lines: &[String]) {
|
||||
let mut sum: u32 = 0;
|
||||
for line in lines {
|
||||
let (left, right) = line.split_at(line.len() / 2);
|
||||
let left_set: HashSet<char> = left.chars().collect();
|
||||
let mut right_set = HashSet::<char>::new();
|
||||
let outlier = right.chars().find(|c| {
|
||||
right_set.insert(*c);
|
||||
left_set.contains(c)
|
||||
}).expect("Expected at least one duplicate item");
|
||||
|
||||
let priority = to_priority(outlier).unwrap();
|
||||
println!("{} ({})", outlier, priority);
|
||||
sum += priority;
|
||||
}
|
||||
|
||||
println!("Sum: {}", sum);
|
||||
}
|
||||
|
||||
fn part2(_lines: &[String]) {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
}
|
Loading…
Reference in a new issue