This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = open("input.txt").read() | |
score = 0 | |
for line in data.split("\n"): | |
player1, player2 = line.split() | |
if player2 == "X": | |
if player1 == "C": | |
score += 6 | |
if player1 == "A": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = open("input.txt").read() | |
current_carried = 0 | |
sum_carried_by_one = [] | |
for food in data.split("\n"): | |
if len(food) == 0: | |
sum_carried_by_one.append(current_carried) | |
current_carried = 0 | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = open("input.txt").read() | |
current_carried = 0 | |
max_carried_by_one = 0 | |
for food in data.split("\n"): | |
if len(food) == 0: | |
current_carried = 0 | |
else: | |
current_carried += int(food) |