2022/day03: Done!

day07
earnest ma 2022-12-03 21:56:28 -05:00
parent 19b014b090
commit bf10fcb367
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
3 changed files with 392 additions and 0 deletions

77
2022/day03.py Normal file
View File

@ -0,0 +1,77 @@
#!/usr/bin/env python3
from typing import TextIO
ltrs = "abcdefghijklmnopqrstuvwxyz"
# lowercase: pos + 1
# uppercase: pos + 27
def find_common_char(one: str, two: str) -> str:
for a in one:
for b in two:
if a == b:
return a
return ""
def find_common_char_three(one: str, two: str, three: str) -> str:
for a in one:
for b in two:
for c in three:
if a == b == c:
return a
return ""
def get_priority(ltr: str) -> int:
n = ltrs.find(ltr.lower())
if ltr.isupper():
return n + 27
return n + 1
def part1(sacks: TextIO) -> int:
sum: int = 0
for sack in sacks:
first = sack[: len(sack) // 2]
second = sack[len(sack) // 2 :]
sum += get_priority(find_common_char(first, second))
return sum
def part2(sacks: TextIO) -> int:
sum: int = 0
line = sacks.readline().strip()
while line != "":
a, b, c = "", "", ""
for i in range(0, 3):
if line != "": # lol
a = line
line = sacks.readline().strip()
b = line
line = sacks.readline().strip()
c = line
line = sacks.readline().strip()
sum += get_priority((find_common_char_three(a, b, c)))
return sum
if __name__ == "__main__":
print(part1(open("day03.txt")))
print(part2(open("day03.txt")))

300
2022/day03.txt Normal file
View File

@ -0,0 +1,300 @@
ZTmtZvZLTFNLMQMNRvZncdcHwcScJvcdHnVfwV
zqjqrzqjCqrjtqWhqChqrznhcfdfVnVSVgcffcgJcSgd
rtDGpzjjqjlrGsWqBWFRsbTPFQMTbRNRFmbs
FFlnlnVlmQqcBVhBRrSrGSwVdRJbztSt
NPPNsffWfNztRZSJNG
WpgpTTHDpgTDDpMLPGgMHslmBmmHcBQnFmcqhmnjlqQm
VlVNLlPQhtnDRPnP
QgqTffzZqgvgzWmqqZmGcDthtRFvnnFnhJtJJDDt
WGTBzSqBQTQmZBWHswpNbswLbSNCNl
PFzFQDdLjMzzQDhnDNmwZmqwRsmRRmMVNM
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def test_part1() -> None:
sacks = open("day03.txt")
assert part1(sacks) == 7716
sacks.close()
def test_part2() -> None:
sacks = open("day03.txt")
assert part2(sacks) == 2973
sacks.close()