Last active
February 21, 2025 00:26
-
-
Save keithrozario/a5f10493fe9fa40773b64c1085fcf9e7 to your computer and use it in GitHub Desktop.
Question 13: Advent of Code
This file contains hidden or 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
prize_x, prize_y = 8400, 5400 | |
a_x, a_y = 94, 34 | |
b_x, b_y = 22, 67 | |
token_counts = [] | |
for a_pushes in 100: | |
for b_pushes in 100: | |
if a_pushes * a_x + b_pushes * b_x == prize_x: | |
if a_pushes * a_y + b_pushes * b_y == prize_y: | |
token_count = 3 * a_pushes + 1 * b_pushes | |
token_counts.append(token_count) | |
min_tokens = min(token_counts) | |
print(f"The minimum number of tokens is {min_tokens}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment