Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def day13_1():
- with open("input.txt", "r") as file:
- data = file.readlines()
- timestamp = int(data[0])
- buses = [int(i) for i in data[1].split(",") if i != "x"]
- next_stop = [b - timestamp % b for b in buses]
- return min(next_stop) * buses[next_stop.index(min(next_stop))]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement