Skip to content

Commit 6d392b9

Browse files
committed
fix gcd logic once again
1 parent 7e37b95 commit 6d392b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

brain_games/games/b_gcd_logic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def b_gcd():
1818
gcd = a
1919
elif a == 0:
2020
gcd = b
21-
while b != 0:
21+
# might as well get some rest
22+
while b != 0 and a != 0:
2223
if max(numbers) % min(numbers) == 0:
2324
gcd = min(numbers)
2425
rem = a % b

0 commit comments

Comments
 (0)