check sum is odd
Verifying solution... Test 1 passed! Test 2 passed! Test 3 failed [Hidden] Test 4 failed [Hidden] Test 5 failed [Hidden]
This commit is contained in:
parent
d548438ea7
commit
cf6d493914
@ -24,6 +24,8 @@ def generate_trainer_pairs(trainer_id_list):
|
||||
yield [(first_id, second_id)] + pairs
|
||||
|
||||
def check_loop(x, y):
|
||||
if (x + y) % 2 == 1: # sum is odd
|
||||
return True
|
||||
a, b = x, y
|
||||
memo = []
|
||||
while a != b:
|
||||
@ -38,6 +40,7 @@ def check_loop(x, y):
|
||||
return False
|
||||
|
||||
tests = [
|
||||
([1], 1),
|
||||
([1, 1], 2),
|
||||
([1, 7, 3, 21, 13, 19], 0),
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user