This commit is contained in:
starnakin 2023-12-07 12:12:57 +01:00
parent 5ad716e9a0
commit c9a3d978d8

View File

@ -19,6 +19,7 @@ sames = []
for line in lines:
bozo: [str] = line.split()
same = get_same(bozo[0])
same.update({"value": int(bozo[1])})
sames.append(same)
@ -29,10 +30,10 @@ def get_highest(cards1, cards2, i):
return 2
if (i != 1 and len(cards1) > len(cards2)):
return 1
for k in range(min(len(cards2), len(cards1))):
if (cards2[k] == cards1[k]):
for char1, char2 in zip(cards1, cards2):
if (char2 == char1):
continue
if (CARDS.index(cards1[k]) > CARDS.index(cards2[k])):
if (CARDS.index(char1) > CARDS.index(char2)):
return 2
else:
return 1
@ -69,7 +70,8 @@ for i, line in enumerate(lines):
key, value = line.split()
for j, bozo in enumerate(sort):
if (bozo.get("original", "") == key):
_value += (len(lines) - j) * int(value)
_value += (len(lines) - j) * bozo.get("value")
print(f'{(len(lines) - j)}, {bozo.get("value")}')
break
print(_value)