day 03
This commit is contained in:
parent
53df6748d7
commit
1c208f534c
|
@ -0,0 +1,12 @@
|
||||||
|
# ---> Rust
|
||||||
|
# Generated by Cargo
|
||||||
|
# will have compiled files and executables
|
||||||
|
/target/
|
||||||
|
|
||||||
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
|
Cargo.lock
|
||||||
|
|
||||||
|
# These are backup files generated by rustfmt
|
||||||
|
**/*.rs.bk
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
[package]
|
||||||
|
name = "aoc_03a"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
|
@ -0,0 +1,300 @@
|
||||||
|
jLnFTjhwFTLFDGDDvLgvDssBJBbVRNZJPPJBGzBNRVJNRB
|
||||||
|
QWmffSmMZCfWrmHlCflQWfSNBpVBNbPSbbJNppcVVzzpcp
|
||||||
|
lflrqrWMmfdMlrtWWmZgDjsqwFwhFDsngnvhqs
|
||||||
|
CNBGwsWVsdWDNCCVvfPLfQfgZHPBvpgf
|
||||||
|
qhJqJlmcFnhJclllPgZjvpHpvfZpPbLn
|
||||||
|
lpMJJhhcSMDMMwws
|
||||||
|
jphtLMfVpjJRjJscMJptssnrwdNwQrNbwNzQTbcNrwQT
|
||||||
|
gSPPSqGGGrdLrNQGrr
|
||||||
|
PvWPDvWWCSSBBZPjLVDfhjsLLsDhtR
|
||||||
|
hlLwDGLNnTrbNdtbdb
|
||||||
|
ZfsvJbsJTrsttHTR
|
||||||
|
vjPQJPFcmZjVFZFvbbVcJZJPBBhLMnDBznnGMDLMwBhlmBBl
|
||||||
|
JdTJFtwHjJTzPMqPccqzjB
|
||||||
|
rggffSCvNBCbWBWt
|
||||||
|
ZsSpnnRpLStrZpTDwTVw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QtLLWLLbp
|
||||||
|
TGwvGgTnGTRHLNtMftWHNbWf
|
||||||
|
vljTGwvvlCljsgSnCBslDPPJrPdVzrSmhdqhVDPP
|
||||||
|
LzCGCGLBGNlLmFFmmSSBBqSc
|
||||||
|
ZJfbdfbWtbgVlblJtjcFcqTmFqqjtFHtjj
|
||||||
|
QgZhZgQVdlfddlWPhfvMCGRGPDMMRvDNGvND
|
||||||
|
nLdpLJSSnLMwjCDwnQhw
|
||||||
|
NZGNgmsgPtPTgWqqCGwRbrDCQbCwhMjr
|
||||||
|
gNqPTqTPttPZqcWfHLlBvccFvhpvJc
|
||||||
|
GNdGhMMvRBjmMVjM
|
||||||
|
trcZJJFmCgfZtcrQCfCZSpqSRjBQpQRQBbBqsSqR
|
||||||
|
JcTmwtTtcrmThLGDhNTThvNW
|
||||||
|
ZqhmtzzfZRsSfRmSTThMpLNgpgJQThMG
|
||||||
|
jdnvdHWFvvjFdCWFrvVVnvFDQrJJMpgMJGNLJNJTPPgQGJGR
|
||||||
|
vnHjDVHBWjdncDRbRzzzmmBsSSzt
|
||||||
|
VZNZSCPTJPpvNTNsCrbnVrLccbLnnRVfWb
|
||||||
|
MlqQBlBztFlhQJdFhccbhnRWWfnggfGc
|
||||||
|
lzJqllwQtmzdHZpvwjPPNspj
|
||||||
|
wTnCMnwQCQvTTJdfqhdtrrSmhttmmm
|
||||||
|
LZlZglZBvjgbHHSrHpbr
|
||||||
|
GWvPjPNGljBzMzJVMwNJMw
|
||||||
|
CSlChlvPPGvdddqPqSJhPdbNbcMTMTbDbcRNDFcFLMLJ
|
||||||
|
HWjgngmBZGQgRRNbFRcHbbzT
|
||||||
|
BmnpnQBBssBsQBnPptSStllGhdCGrS
|
||||||
|
nhQCnCvjchBBjMNrwbRwZvvSvSWW
|
||||||
|
qgHlfqblVbPfVqlbGgPGfdfLSdNssWWLZsNsLZsdNdLSZZ
|
||||||
|
gbGHzzbzHtPfcJhczmMnQBJn
|
||||||
|
TTGJJPPZJGRzDwtQj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vmbBqlRWlCtCqlRZqRtW
|
||||||
|
HmTjNdmMfTTVvLSzvz
|
||||||
|
WMQWmfGfQfVnMGWGmGtGWHzZtdLzpZhwrtZcwZzdps
|
||||||
|
jBgljNPbNjPFRbggNlNBCcHsrLLLHlrLslhlzdhdHppp
|
||||||
|
BBPBJbFCTGJcVQMGMv
|
||||||
|
fdmfmmjbPmjlmfhfGglTNLCNvPNSpPvpvSLCPCpS
|
||||||
|
MtJwMrwrZJVHMgqJHtwVJzVVLCvpNLvDrLvQSQSNcCNpFNLS
|
||||||
|
wWMVWZzqqMRHztwJZzRqVtjGlBdhbGGbThhTlnTBTWgb
|
||||||
|
ShhrjPrvhlljnHrggPvvSqRMBZZqBTZmMmTmTMdD
|
||||||
|
ctLzbcpWCJbNWRQqBBdZFMBdfZdJBm
|
||||||
|
GQWpzLcVpVNpRggHrhhgvnGPwj
|
||||||
|
PdzSrmmqSgWWddNQds
|
||||||
|
TZbwCTLZbHLWptQHhpgNsc
|
||||||
|
MZjBLjMLDTDqrrGflsjjrf
|
||||||
|
DBHTnlGGBPjPmwRWhn
|
||||||
|
hgLgZccSrcMgLMSpCLJjNWmPWjmVWdwJjd
|
||||||
|
MfQMScQrMSprrTGHBhqTvqlGQT
|
||||||
|
CDvLRCCzQDWzcGQGvRcpVFVsgTsFrgllrTpF
|
||||||
|
mjbqtHqHbspspnMv
|
||||||
|
ZvvqdqqHvLhDhJWzJd
|
||||||
|
ThHnbRTVbQHSWvBVVBCPBW
|
||||||
|
FFJgfqfqNwNrvDCBNppP
|
||||||
|
jzsFfqwqssLzJjffJcssHQHQdnMdhTGHLbddbCnn
|
||||||
|
gwMHHhbSwnqHrgMqMbnBcldhzBLQBQhBLtLttQ
|
||||||
|
dCRmpfvpCzcQllflQz
|
||||||
|
TjPsCJmvZPNPsvZpPTTRCpprjdbrHngqDwqMrDnMbMbHgM
|
||||||
|
CgNQpgTCgNltHTNQlHpRnRnzBfJnPnmpcpfq
|
||||||
|
LGrrvGSMGvrsWPBmnJPmPfmrqr
|
||||||
|
VGsSvdJvbSHVtlttNVHT
|
||||||
|
LnZDtzpzNpPsCbfBbDCDBC
|
||||||
|
gSGRSSghqhhSvSRvvhvVqFJdsfBsCHJbVfddCJ
|
||||||
|
vglRRjQSmnQQCNrL
|
||||||
|
HwhVddVVwRcGHGjlfS
|
||||||
|
MbBvDBGvWqpNWvMbzDMNZZlLcjlSclflcjqgfCRg
|
||||||
|
bvDWDWQbspPPWWQMnGdnFnJtJFGJhhPJ
|
||||||
|
nDJDdQdPDlDJnnbRQDlTqVfFwfVtjJjjFfqqFqgN
|
||||||
|
hScrSmSCTZvZCSmZLFwfffqgjfhNGwjhfw
|
||||||
|
zCzsCCTcMBmSLmsMWHdPWRQPQPddDQ
|
||||||
|
lzGflPZLSqSlccpqjpdNCwjdsjCnCsJp
|
||||||
|
VghPQDVMFQNdJjRNBw
|
||||||
|
tVrhDVmHTlPlGrzL
|
||||||
|
gfSJJlzvGgRPpggR
|
||||||
|
VLDDHhHtlZnnZqbGmtqPmmmmWN
|
||||||
|
VVDBnddDBFFzlscC
|
||||||
|
cmmzRzcRjFrGncTHqc
|
||||||
|
ghJfwJJvqhbrdndWgddWBH
|
||||||
|
fQbSpJwSthbhtvpCwqQbsDPMNLlpRmplzPlRMPzM
|
||||||
|
bBVQDgBpTzbhpgQVhTmBVBzgrvcnrncsnZrwzHJZfnHcZfrP
|
||||||
|
tdWlFLMHGFGRGMRLNFHlfwJcrPwcsnfwcvZPfr
|
||||||
|
RLWGjHLjSjtjmBQVgpQhhg
|
||||||
|
ttRRJBrCfpprmFqSJVTSwNJNTWlVTn
|
||||||
|
nLsMghDbQdnhwWNLjcwNSlVH
|
||||||
|
ZZDgnDQvDdndPCmfrRqzvFqpmp
|
||||||
|
PPzCrcGGlnhPcsdfNZZdpLLNZsfd
|
||||||
|
RjjWHjVWDvjWqVMHjHJjVlHdwwJbLfNZdfdgfpppgpfpZw
|
||||||
|
lBVvqjQqBDBlVmCFGChhnSmTTr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szQsGQcVNqTBBdVj
|
||||||
|
rHGBglBNLpbqCgFC
|
||||||
|
PbmbRnmMSbRPDWRnDVSMPMWmvvcvqqppTLZZFpvCpczLcCVv
|
||||||
|
dsdMSPtMdPnSffQwGGsBBbQw
|
||||||
|
nqjTlGPGnqWsMPPwGdGjQvQvJCCQBvmvCvQJtmCw
|
||||||
|
DDhVbDrcVVFZLzHrZBRNCWStmQWztJvtCm
|
||||||
|
VHDLhFFDpcHZcHGWfsGlspTTMqps
|
||||||
|
FTPZwBzHHFLTTSwHLJTwVQqnDrzgRRVgQpDVRprn
|
||||||
|
jJMjsWlvQqVrqgWW
|
||||||
|
CjNsjjvlmslbcJmmbtCtCThdwhHLhhhLPdBCSPFh
|
||||||
|
jfgllWfLrfmlTjsCjcjDNNDnNcHJnd
|
||||||
|
MMBRSRZGppGFpBbbBGvVnFHhcCJqNcNcHCFNgnnn
|
||||||
|
pMZZgBRVZVGRtRSMbMbvRQmTswWfzLzLzWLrPQmfwLlW
|
||||||
|
tzpdHLNpfpPnlNFHnpssbgShtqcgTTggrsqg
|
||||||
|
JZwWGCWMCcbsSHgWjq
|
||||||
|
QCmDZCJwmvZvCVCVRQGCDMFBNlfHmfLLzPPfdpfBLlPB
|
||||||
|
PCvRTdPPBVBTGgLGrGqMrMnv
|
||||||
|
twQwStrsQwstjSHmmpqZpwqNGnGnNnZgLN
|
||||||
|
mJScfjbttQjQtjcmfbbQJHFTBfdfRhhrPhhTfPVVhPPB
|
||||||
|
DMPJmLLjhJwNBCNBww
|
||||||
|
TpccnsZsbTHpsTHVszbpbGHSNwBtWlfrtCtCfrtlBlFZlf
|
||||||
|
HsHvccvzbqsGzqnnHvLQPghQNNDDvLLjdjLR
|
||||||
|
zmgVMrrjjMGbbzzdqqrgVbRTHqTTThpNHphNTvvvTNnv
|
||||||
|
QLSmZmSJTvTnZTvn
|
||||||
|
SfDtDDmQCFDwWmSrjPPGfjMjjGfMgV
|
||||||
|
hdNHNHjnGHMTcpWlhBchRBJR
|
||||||
|
fPztCTPtttLwLzVbwqSVtCBBDpWvlcRRlBpbDBQWcDWJ
|
||||||
|
ftrCVzfTCFFzTFPrPjNZFHnNsMdZgjHdss
|
||||||
|
TVcTbdqLqzHHRNHM
|
||||||
|
PppQTWffPfCPQSsCprzRwRJDzMDzNwRBRPHN
|
||||||
|
pjCTZjTjmTtsZhGcGdLvdlgv
|
||||||
|
VJRhVfJRBgbdrrrvJpJJ
|
||||||
|
cCSSHSHnZPwDFNHCDCQdbQQdvqnMsrpqQnvq
|
||||||
|
NFFCwSrDzCNrwhtgzhWtBhgzWB
|
||||||
|
RRBRczzcvmfzVRzVPvPTlCWnnlTGqGMgTTnG
|
||||||
|
tNLdSdNSMFhsFttddtjlwGqllqQglqTWqwnThT
|
||||||
|
rLSsLrNdZbbHjLdSFFMjLLtSfVRJzVJJVZcRfvZVRfDpVvRz
|
||||||
|
DBsdssbdbDfPnnqzzJbqStqzjjJS
|
||||||
|
RcGMGwwmrJjFFHPG
|
||||||
|
mCgwMLPgCPmmwWDBDZvWvBCWfZ
|
||||||
|
cJCGJJMZcMGWMhWCJTfFSfDmmgFmtshggffr
|
||||||
|
vBVQBDbNstQmFsfm
|
||||||
|
RVwHNblzwHvNdvBwNjVHGZJZLJTMLMJDZLGRMDGG
|
||||||
|
LNCssCldDbrnNtVWNQ
|
||||||
|
mmcpRBMBRBTZzgMMhtFFvrWQrQmWFtvn
|
||||||
|
MZTgzMZSzTfSMDHwCfPlLLDnwL
|
||||||
|
HlPcjMSHsMSPbgLhFPFNzP
|
||||||
|
ZfRhtVdGBNLFzLqf
|
||||||
|
DRtGGtRGJJTJDZDGdCJrVJmlWvHWcvjMsMWmhQsmCMjW
|
||||||
|
swpQcsBvvHFpBHHcCHJvJddvbbWPdzhzzqqWdhPnhP
|
||||||
|
gDDGTgjNWZTMTNjjggRLggldSPqSqGznnhnbdfnbqfhh
|
||||||
|
WDMDtDNDctVFJstJ
|
||||||
|
rFDbGjrGbpBBbrCbrwpvvZQZZhgTLVVVVLgThCTggg
|
||||||
|
NlfHpttqzltMzRSMSdWRNSfSTTmqgcLgQVcQTcmgQgmZVPVZ
|
||||||
|
HWSWpMHNpNWlpNMsMzWGGwwBvvwBnwBvsnnvnB
|
||||||
|
mZVVHmmRZlvdjvNpHh
|
||||||
|
DFBnFDtnFbBMrQbBMvFLvgtjjNpcLpJdNzJJdhWNpJNWcN
|
||||||
|
QTsbrQggBsvsgVTwRVGZCfGZfR
|
||||||
|
RGNGlGTWJnJlMcRMGqvSmnDtvDDvtLSLvr
|
||||||
|
HfsFhPPdVshfbggDVmzcvSwvStVzDq
|
||||||
|
BPPfCgCFfcBbPbHbBHZPFsbBpMGlClRNJRlQTjQWjWpTTlGT
|
||||||
|
HQNqQbbRQHbZPZQPqbZTvWFWmCjvFRvRTSrRrr
|
||||||
|
lBpBpzLLdBwsLwLLWNggzCFTCmFgWmrF
|
||||||
|
VwsswGVBfJfccLBcsJGNdpJHZZqnhtqqnhPHDZHVtPQMZn
|
||||||
|
LMHnHnPMnFdJFNFJjZvrJF
|
||||||
|
wlTlslptlwtzcvTqvTsVSWWrbJfmJZNZJjcNWfNJmf
|
||||||
|
qDlqVthTztSSpSlqtpTTzLvRRnnCvRCPLBQGDBdDGD
|
||||||
|
HlmlJgRBBpJLpPBHnlLJsrgJDMttvSdddcMSStWjjWtcSzjs
|
||||||
|
qfTbNPTVGhGFCVGTwZfNZNNVWvjSczcjStMMcdSczzczvbcW
|
||||||
|
GZVqffQTwNQTmPRlggHLprHQ
|
||||||
|
BjsWschcTjjWclQTSnZFrjtFtbzZfqntzF
|
||||||
|
qggNGMHgvHMRZMtznbrftMCn
|
||||||
|
qvHdqpwgJTsVccwscT
|
||||||
|
FJwNPHJmPHTJHglTFwgmwqtShBqDmDBzzBzWhCDWqQ
|
||||||
|
fpsjNsMVLVjDCCSzBtjztt
|
||||||
|
sLrdfbsMcbMRZZZbbsfrsrNgGNglRwllRnJnwFvnFHnG
|
||||||
|
lWWVTJlJCTTzDdWzqdtFFt
|
||||||
|
PvPvrhbjhgSjvJQSnQRbjZDZFFHMtGGqFtRMGZFtGH
|
||||||
|
rhPrSgfvJPfmwsTpLcsV
|
|
@ -0,0 +1 @@
|
||||||
|
rhPrSgfvJPfmwsTpLcsV
|
|
@ -0,0 +1,6 @@
|
||||||
|
vJrwpWtwJgWrhcsFMMfFFhFp
|
||||||
|
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
|
||||||
|
PmmdzqPrVvPwwTWBwg
|
||||||
|
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
|
||||||
|
ttgJtRGJQctTZtZT
|
||||||
|
CrZsJsPPZsGzwwsLwLmpwMDw
|
|
@ -0,0 +1,50 @@
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io::{self, BufRead};
|
||||||
|
use std::path::Path;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_03a/input");
|
||||||
|
let mut result = 0;
|
||||||
|
|
||||||
|
println!("In file {}", file_path);
|
||||||
|
|
||||||
|
if let Ok(lines) = read_lines(file_path) {
|
||||||
|
// Consumes the iterator, returns an (Optional) String
|
||||||
|
for line in lines {
|
||||||
|
if let Ok(ip) = line {
|
||||||
|
let len = ip.len();
|
||||||
|
let mut i = 0;
|
||||||
|
let mut hashmap = HashMap::new();
|
||||||
|
for c in ip.chars() {
|
||||||
|
if i < len / 2 {
|
||||||
|
hashmap.insert(c, Some(0));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
match hashmap.get(&c) {
|
||||||
|
Some(&_number) => {
|
||||||
|
if c >= 'A' && c <= 'Z' {
|
||||||
|
result += 27 + c as u32 - 'A' as u32;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result += 1 + c as u32 - 'a' as u32;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_ => result += 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("{}", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
|
||||||
|
where P: AsRef<Path>, {
|
||||||
|
let file = File::open(filename)?;
|
||||||
|
Ok(io::BufReader::new(file).lines())
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
# ---> Rust
|
||||||
|
# Generated by Cargo
|
||||||
|
# will have compiled files and executables
|
||||||
|
/target/
|
||||||
|
|
||||||
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
|
Cargo.lock
|
||||||
|
|
||||||
|
# These are backup files generated by rustfmt
|
||||||
|
**/*.rs.bk
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
[package]
|
||||||
|
name = "aoc_03b"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
|
@ -0,0 +1,300 @@
|
||||||
|
jLnFTjhwFTLFDGDDvLgvDssBJBbVRNZJPPJBGzBNRVJNRB
|
||||||
|
QWmffSmMZCfWrmHlCflQWfSNBpVBNbPSbbJNppcVVzzpcp
|
||||||
|
lflrqrWMmfdMlrtWWmZgDjsqwFwhFDsngnvhqs
|
||||||
|
CNBGwsWVsdWDNCCVvfPLfQfgZHPBvpgf
|
||||||
|
qhJqJlmcFnhJclllPgZjvpHpvfZpPbLn
|
||||||
|
lpMJJhhcSMDMMwws
|
||||||
|
jphtLMfVpjJRjJscMJptssnrwdNwQrNbwNzQTbcNrwQT
|
||||||
|
gSPPSqGGGrdLrNQGrr
|
||||||
|
PvWPDvWWCSSBBZPjLVDfhjsLLsDhtR
|
||||||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jRQQvfRgwpgHHpppHhZbzfCpbHtH
|
||||||
|
TTwBnnZwBnNQZZWLWTTFNFbsCGrGFCNvDDDGFj
|
||||||
|
lzPRfVVRMclPRMRcbFDjfCCGvvsdGCDd
|
||||||
|
hSmmlMlVztlhRlVbqQpLnWqSqLZZwZQT
|
||||||
|
zzVTcqmVqzdmhZJbFpQZQQtLLWLLbp
|
||||||
|
TGwvGgTnGTRHLNtMftWHNbWf
|
||||||
|
vljTGwvvlCljsgSnCBslDPPJrPdVzrSmhdqhVDPP
|
||||||
|
LzCGCGLBGNlLmFFmmSSBBqSc
|
||||||
|
ZJfbdfbWtbgVlblJtjcFcqTmFqqjtFHtjj
|
||||||
|
QgZhZgQVdlfddlWPhfvMCGRGPDMMRvDNGvND
|
||||||
|
nLdpLJSSnLMwjCDwnQhw
|
||||||
|
NZGNgmsgPtPTgWqqCGwRbrDCQbCwhMjr
|
||||||
|
gNqPTqTPttPZqcWfHLlBvccFvhpvJc
|
||||||
|
GNdGhMMvRBjmMVjM
|
||||||
|
trcZJJFmCgfZtcrQCfCZSpqSRjBQpQRQBbBqsSqR
|
||||||
|
JcTmwtTtcrmThLGDhNTThvNW
|
||||||
|
ZqhmtzzfZRsSfRmSTThMpLNgpgJQThMG
|
||||||
|
jdnvdHWFvvjFdCWFrvVVnvFDQrJJMpgMJGNLJNJTPPgQGJGR
|
||||||
|
vnHjDVHBWjdncDRbRzzzmmBsSSzt
|
||||||
|
VZNZSCPTJPpvNTNsCrbnVrLccbLnnRVfWb
|
||||||
|
MlqQBlBztFlhQJdFhccbhnRWWfnggfGc
|
||||||
|
lzJqllwQtmzdHZpvwjPPNspj
|
||||||
|
wTnCMnwQCQvTTJdfqhdtrrSmhttmmm
|
||||||
|
LZlZglZBvjgbHHSrHpbr
|
||||||
|
GWvPjPNGljBzMzJVMwNJMw
|
||||||
|
CSlChlvPPGvdddqPqSJhPdbNbcMTMTbDbcRNDFcFLMLJ
|
||||||
|
HWjgngmBZGQgRRNbFRcHbbz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Jn
|
||||||
|
FWpRfFRjtjFpVvbTTZFPhJhJLdCLdWBhPmHmCW
|
||||||
|
McMzNlGrgGGsHcqmdLqbhJmd
|
||||||
|
lNMwsnMzzsSSGtVVSfvZTtSppb
|
||||||
|
JrJQDJDVvGwGVwvcGCRRcCBBqsWBRZqWZZ
|
||||||
|
bNdmhvMpjmHbNbpNvmbBqlRWlCtCqlRZqRtW
|
||||||
|
HmTjNdmMfTTVvLSzvz
|
||||||
|
WMQWmfGfQfVnMGWGmGtGWHzZtdLzpZhwrtZcwZzdps
|
||||||
|
jBgljNPbNjPFRbggNlNBCcHsrLLLHlrLslhlzdhdHppp
|
||||||
|
BBPBJbFCTGJcVQMGMv
|
||||||
|
fdmfmmjbPmjlmfhfGglTNLCNvPNSpPvpvSLCPCpS
|
||||||
|
MtJwMrwrZJVHMgqJHtwVJzVVLCvpNLvDrLvQSQSNcCNpFNLS
|
||||||
|
wWMVWZzqqMRHztwJZzRqVtjGlBdhbGGbThhTlnTBTWgb
|
||||||
|
ShhrjPrvhlljnHrggPvvSqRMBZZqBTZmMmTmTMdD
|
||||||
|
ctLzbcpWCJbNWRQqBBdZFMBdfZdJBm
|
||||||
|
GQWpzLcVpVNpRggHrhhgvnGPwj
|
||||||
|
PdzSrmmqSgWWddNQds
|
||||||
|
TZbwCTLZbHLWptQHhpgNsc
|
||||||
|
MZjBLjMLDTDqrrGflsjjrf
|
||||||
|
DBHTnlGGBPjPmwRWhn
|
||||||
|
hgLgZccSrcMgLMSpCLJjNWmPWjmVWdwJjd
|
||||||
|
MfQMScQrMSprrTGHBhqTvqlGQT
|
||||||
|
CDvLRCCzQDWzcGQGvRcpVFVsgTsFrgllrTpF
|
||||||
|
mjbqtHqHbspspnMv
|
||||||
|
ZvvqdqqHvLhDhJWzJd
|
||||||
|
ThHnbRTVbQHSWvBVVBCPBW
|
||||||
|
FFJgfqfqNwNrvDCBNppP
|
||||||
|
jzsFfqwqssLzJjffJcssHQHQdnMdhTGHLbddbCnn
|
||||||
|
gwMHHhbSwnqHrgMqMbnBcldhzBLQBQhBLtLttQ
|
||||||
|
dCRmpfvpCzcQllflQz
|
||||||
|
TjPsCJmvZPNPsvZpPTTRCpprjdbrHngqDwqMrDnMbMbHgM
|
||||||
|
CgNQpgTCgNltHTNQlHpRnRnzBfJnPnmpcpfq
|
||||||
|
LGrrvGSMGvrsWPBmnJPmPfmrqr
|
||||||
|
VGsSvdJvbSHVtlttNVHT
|
||||||
|
LnZDtzpzNpPsCbfBbDCDBC
|
||||||
|
gSGRSSghqhhSvSRvvhvVqFJdsfBsCHJbVfddCJ
|
||||||
|
vglRRjQSmnQQCNrL
|
||||||
|
HwhVddVVwRcGHGjlfS
|
||||||
|
MbBvDBGvWqpNWvMbzDMNZZlLcjlSclflcjqgfCRg
|
||||||
|
bvDWDWQbspPPWWQMnGdnFnJtJFGJhhPJ
|
||||||
|
nDJDdQdPDlDJnnbRQDlTqVfFwfVtjJjjFfqqFqgN
|
||||||
|
hScrSmSCTZvZCSmZLFwfffqgjfhNGwjhfw
|
||||||
|
zCzsCCTcMBmSLmsMWHdPWRQPQPddDQ
|
||||||
|
lzGflPZLSqSlccpqjpdNCwjdsjCnCsJp
|
||||||
|
VghPQDVMFQNdJjRNBw
|
||||||
|
tVrhDVmHTlPlGrzL
|
||||||
|
gfSJJlzvGgRPpggR
|
||||||
|
VLDDHhHtlZnnZqbGmtqPmmmmWN
|
||||||
|
VVDBnddDBFFzlscC
|
||||||
|
cmmzRzcRjFrGncTHqc
|
||||||
|
ghJfwJJvqhbrdndWgddWBH
|
||||||
|
fQbSpJwSthbhtvpCwqQbsDPMNLlpRmplzPlRMPzM
|
||||||
|
bBVQDgBpTzbhpgQVhTmBVBzgrvcnrncsnZrwzHJZfnHcZfrP
|
||||||
|
tdWlFLMHGFGRGMRLNFHlfwJcrPwcsnfwcvZPfr
|
||||||
|
RLWGjHLjSjtjmBQVgpQhhg
|
||||||
|
ttRRJBrCfpprmFqSJVTSwNJNTWlVTn
|
||||||
|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tWlbnnZnFBhbNfrhN
|
||||||
|
dQLZHjpDQCfBBBBTGTTC
|
||||||
|
DJvDpDSzSDQZMWsWwPqVtwcS
|
||||||
|
NVTMjjGGNBqhNttdTTjtcqjCfDlhZhSWCFFJmSmZmWJhmZ
|
||||||
|
rznsHPnRLzwspZDWfGZJSLZZDC
|
||||||
|
QzPRRvRQszQsGQcVNqTBBdVj
|
||||||
|
rHGBglBNLpbqCgFC
|
||||||
|
PbmbRnmMSbRPDWRnDVSMPMWmvvcvqqppTLZZFpvCpczLcCVv
|
||||||
|
dsdMSPtMdPnSffQwGGsBBbQw
|
||||||
|
nqjTlGPGnqWsMPPwGdGjQvQvJCCQBvmvCvQJtmCw
|
||||||
|
DDhVbDrcVVFZLzHrZBRNCWStmQWztJvtCm
|
||||||
|
VHDLhFFDpcHZcHGWfsGlspTTMqps
|
||||||
|
FTPZwBzHHFLTTSwHLJTwVQqnDrzgRRVgQpDVRprn
|
||||||
|
jJMjsWlvQqVrqgWW
|
||||||
|
CjNsjjvlmslbcJmmbtCtCThdwhHLhhhLPdBCSPFh
|
||||||
|
jfgllWfLrfmlTjsCjcjDNNDnNcHJnd
|
||||||
|
MMBRSRZGppGFpBbbBGvVnFHhcCJqNcNcHCFNgnnn
|
||||||
|
pMZZgBRVZVGRtRSMbMbvRQmTswWfzLzLzWLrPQmfwLlW
|
||||||
|
tzpdHLNpfpPnlNFHnpssbgShtqcgTTggrsqg
|
||||||
|
JZwWGCWMCcbsSHgWjq
|
||||||
|
QCmDZCJwmvZvCVCVRQGCDMFBNlfHmfLLzPPfdpfBLlPB
|
||||||
|
PCvRTdPPBVBTGgLGrGqMrMnv
|
||||||
|
twQwStrsQwstjSHmmpqZpwqNGnGnNnZgLN
|
||||||
|
mJScfjbttQjQtjcmfbbQJHFTBfdfRhhrPhhTfPVVhPPB
|
||||||
|
DMPJmLLjhJwNBCNBww
|
||||||
|
TpccnsZsbTHpsTHVszbpbGHSNwBtWlfrtCtCfrtlBlFZlf
|
||||||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GdCJrVJmlWvHWcvjMsMWmhQsmCMjW
|
||||||
|
swpQcsBvvHFpBHHcCHJvJddvbbWPdzhzzqqWdhPnhP
|
||||||
|
gDDGTgjNWZTMTNjjggRLggldSPqSqGznnhnbdfnbqfhh
|
||||||
|
WDMDtDNDctVFJstJ
|
||||||
|
rFDbGjrGbpBBbrCbrwpvvZQZZhgTLVVVVLgThCTggg
|
||||||
|
NlfHpttqzltMzRSMSdWRNSfSTTmqgcLgQVcQTcmgQgmZVPVZ
|
||||||
|
HWSWpMHNpNWlpNMsMzWGGwwBvvwBnwBvsnnvnB
|
||||||
|
mZVVHmmRZlvdjvNpHh
|
||||||
|
DFBnFDtnFbBMrQbBMvFLvgtjjNpcLpJdNzJJdhWNpJNWcN
|
||||||
|
QTsbrQggBsvsgVTwRVGZCfGZfR
|
||||||
|
RGNGlGTWJnJlMcRMGqvSmnDtvDDvtLSLvr
|
||||||
|
HfsFhPPdVshfbggDVmzcvSwvStVzDq
|
||||||
|
BPPfCgCFfcBbPbHbBHZPFsbBpMGlClRNJRlQTjQWjWpTTlGT
|
||||||
|
HQNqQbbRQHbZPZQPqbZTvWFWmCjvFRvRTSrRrr
|
||||||
|
lBpBpzLLdBwsLwLLWNggzCFTCmFgWmrF
|
||||||
|
VwsswGVBfJfccLBcsJGNdpJHZZqnhtqqnhPHDZHVtPQMZn
|
||||||
|
LMHnHnPMnFdJFNFJjZvrJF
|
||||||
|
wlTlslptlwtzcvTqvTsVSWWrbJfmJZNZJjcNWfNJmf
|
||||||
|
qDlqVthTztSSpSlqtpTTzLvRRnnCvRCPLBQGDBdDGD
|
||||||
|
HlmlJgRBBpJLpPBHnlLJsrgJDMttvSdddcMSStWjjWtcSzjs
|
||||||
|
qfTbNPTVGhGFCVGTwZfNZNNVWvjSczcjStMMcdSczzczvbcW
|
||||||
|
GZVqffQTwNQTmPRlggHLprHQ
|
||||||
|
BjsWschcTjjWclQTSnZFrjtFtbzZfqntzF
|
||||||
|
qggNGMHgvHMRZMtznbrftMCn
|
||||||
|
qvHdqpwgJTsVccwscT
|
||||||
|
FJwNPHJmPHTJHglTFwgmwqtShBqDmDBzzBzWhCDWqQ
|
||||||
|
fpsjNsMVLVjDCCSzBtjztt
|
||||||
|
sLrdfbsMcbMRZZZbbsfrsrNgGNglRwllRnJnwFvnFHnG
|
||||||
|
lWWVTJlJCTTzDdWzqdtFFt
|
||||||
|
PvPvrhbjhgSjvJQSnQRbjZDZFFHMtGGqFtRMGZFtGH
|
||||||
|
rhPrSgfvJPfmwsTpLcsV
|
|
@ -0,0 +1 @@
|
||||||
|
rhPrSgfvJPfmwsTpLcsV
|
|
@ -0,0 +1,6 @@
|
||||||
|
vJrwpWtwJgWrhcsFMMfFFhFp
|
||||||
|
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
|
||||||
|
PmmdzqPrVvPwwTWBwg
|
||||||
|
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
|
||||||
|
ttgJtRGJQctTZtZT
|
||||||
|
CrZsJsPPZsGzwwsLwLmpwMDw
|
|
@ -0,0 +1,59 @@
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io::{self, BufRead};
|
||||||
|
use std::path::Path;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_03b/input");
|
||||||
|
let mut result = 0;
|
||||||
|
let mut i = 0;
|
||||||
|
let mut hashmap = HashMap::new();
|
||||||
|
|
||||||
|
println!("In file {}", file_path);
|
||||||
|
|
||||||
|
if let Ok(lines) = read_lines(file_path) {
|
||||||
|
// Consumes the iterator, returns an (Optional) String
|
||||||
|
for line in lines {
|
||||||
|
if i == 0 {
|
||||||
|
hashmap = HashMap::new();
|
||||||
|
}
|
||||||
|
if let Ok(ip) = line {
|
||||||
|
println!("{:?}", hashmap);
|
||||||
|
for c in ip.chars() {
|
||||||
|
if i == 0 {
|
||||||
|
hashmap.insert(c, 100);
|
||||||
|
}
|
||||||
|
else if i == 1 {
|
||||||
|
*hashmap.entry(c).or_insert(2) += 1;
|
||||||
|
}
|
||||||
|
else if i == 2 {
|
||||||
|
match hashmap.get(&c) {
|
||||||
|
Some(&number) => {
|
||||||
|
if number > 100 {
|
||||||
|
println!("{}", c);
|
||||||
|
if c >= 'A' && c <= 'Z' {
|
||||||
|
result += 27 + c as u32 - 'A' as u32;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result += 1 + c as u32 - 'a' as u32;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i = (i + 1) % 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("{}", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
|
||||||
|
where P: AsRef<Path>, {
|
||||||
|
let file = File::open(filename)?;
|
||||||
|
Ok(io::BufReader::new(file).lines())
|
||||||
|
}
|
Loading…
Reference in New Issue