d1p1 done

This commit is contained in:
Tanishq Dubey 2023-12-02 16:24:18 -05:00
parent e9e03756f8
commit a3820f7e2a
4 changed files with 1035 additions and 0 deletions

1000
day1/input Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
data = []
with open('input') as f:
data = f.readlines()
total = 0
for d in data:
dstring = ''.join(filter(str.isdigit, d))
d1 = dstring[0]
d2 = dstring[-1]
print(d1, "-", d2)
total = total + int(f"{d1}{d2}")
print("=======")
print(total)
print("=======")
# Part 2

4
day1/test Normal file
View File

@ -0,0 +1,4 @@
1abc2
pqr3stu8vwx
a1b2c3d4e5f
treb7uchet

7
day1/test2 Normal file
View File

@ -0,0 +1,7 @@
two1nine
eightwothree
abcone2threexyz
xtwone3four
4nineeightseven2
zoneight234
7pqrstsixteen