diff options
author | Marvin Borner | 2022-12-03 06:11:39 +0100 |
---|---|---|
committer | Marvin Borner | 2022-12-03 06:11:39 +0100 |
commit | fc738bf428da8381136855b8de478349ea239e13 (patch) | |
tree | 4437bd6ec5be29d7e34db5f3f6055ab89f6825a1 /2022/03 | |
parent | a1819f735e5939bad4f92ca90fd8163f4723eb31 (diff) |
lesgo
Diffstat (limited to '2022/03')
-rw-r--r-- | 2022/03/input | 300 | ||||
-rw-r--r-- | 2022/03/solve.py | 30 |
2 files changed, 330 insertions, 0 deletions
diff --git a/2022/03/input b/2022/03/input new file mode 100644 index 0000000..5282006 --- /dev/null +++ b/2022/03/input @@ -0,0 +1,300 @@ +NLBLfrNNLvqwbMfDqSjSzzSJjjggcdVs +lTRGPPZnRRHszcsZdSsccZ +CFTTFtFHTtCtDDzrmBtrBD +BJldgBWnRgWNWtllSlWShMcLcVSvVjbVVVvDVVVL +HFGFwqQPQGwHrTFpwmThMbDDVcVmLvvshj +HrpHrGPZZCQrfqlNdtMlzfMltlgn +hQLhBtBtQNQjBjNLvtLjzLJpWbjJdppSwjpCCplllJdj +FGFsmccSPTVPfVVHpJJgwlJwwWJWpCmR +sFPfPFHZTHScnzBttqzvQzqZ +MNTGMTnGWvTwwwnZhNZnWDPPdSjqsSPWjmBCSBWS +RJrtVfRlLrfHgblHJVBjqqFmjCdBJjDmJdSD +tgRftftRcRLftrpHpflHlctVwNNvZNcTwZnznQzwTzmhQwQh +sQPpQpQhnlNsJpJSQphHcZffLfgLHSfHVHHFZZ +zBCvrrWzTwqzcbtbqCbrCCwWLMfVVmmHVfqHFHFgGHLZGmVG +rvvjBzTjrwQRcpjNsRss +RrnNWJJNrplbLJBBWWZstVpmtZftptfmfsMM +GHjnwndzGcqjGgqtfMsvfsMmMvZZ +cQgwHTPjPwGwjdHHTjwccQBDLlWNrLJLNrnWrBRBlS +BBBQJGQslJtcGqfgHpPnfftwqw +RDMLDWLNTLTTNjNgvdqbqRnwqbfwPRzbVHHV +mgdNgdTS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RzRfV +nlNZWZlJngbvNjgZhNvHhJvprcTclFCcTPSlTCcSpFcLrG +PdHJVCbSJmSVHdLdHbsbsqRwnlDWhZnZccWqDwqDVw +NvMFlGrQTvgpggFNwZhwWWhhqRWRhTqz +gMjvtMpNMrfFrvlffgmdjLLjCmmLHBddLJBS +zNrlzhJGdlHGHplCJQQVbLhRFRbccDSbVDLqRb +WwmwnWjvjmjZPPFFFRDZqVbqqJBS +tmjMJstnWnjvnsTnQMfrQMldrGlCrGfl +MqWfZlpjMPBgffgPNNQnVnnqRsNVLVmR +TcwGCTSvthpzCCTNVnsQVSnRnRQnNn +TbrpDvvCvCwTGDzvzhpzDzljHBZbHWZgHPZJZjJJHfPf +DWNNQQHRpsRWDQPQqHqqgJBCsjjsFFFngBzgjJzl +tMhMwTrTDLMdmMLtMMrbmVbZhJJnnFCCjnlJjjjjBzFBgZ +ttTtDmbfqWcWfqPp +QhvTQqggFsmvjsFTmqZrzzwZrHnwpnplpZ +WCJVGCSLtDPPtHDbHDbdpnrMnMrrpwlZrwpznLpl +VVJbbVfStVHJJVtGmvsfjvssFFTvvsQj +pBCqCqhWjpnWCnffJDjfWzJBZdcvwcPdvJvJcgcrdGdvggrv +tlhbHbmNTbQgbGRvbZGrcg +tVFLQNVlmTmQLQhpzMCBzCpzjjFMnz +qhWHwNqLHrLJjqgHddFchMdnnGnRhMcR +pTzTPVfZQPffNVtVVZfptRGsRbbbbcDsMMZsMZMdRn +CfzPVzCfPBzPBqvWqgBwjNLjjS diff --git a/2022/03/solve.py b/2022/03/solve.py new file mode 100644 index 0000000..68b58c2 --- /dev/null +++ b/2022/03/solve.py @@ -0,0 +1,30 @@ +data = [dat.strip() for dat in open("input").read().split("\n") if dat != ''] + +def part1(): + res = 0 + + for line in data: + comp1 = list(line[len(line)//2:]) + comp2 = list(line[:len(line)//2]) + inter = list(set(comp1).intersection(comp2))[0] + if inter.islower(): + res += ord(inter) - ord('a') + 1 + elif inter.isupper(): + res += ord(inter) - ord('A') + 27 + + return res + +def part2(): + res = 0 + + for i in range(0, len(data), 3): + common = list(set(data[i]).intersection(data[i+1]).intersection(data[i+2]))[0] + if common.islower(): + res += ord(common) - ord('a') + 1 + elif common.isupper(): + res += ord(common) - ord('A') + 27 + + return res + +print(f"Part 1: {part1()}") +print(f"Part 2: {part2()}") |