diff --git a/extra/distract-the-trainers/solution.py b/extra/distract-the-trainers/solution.py index a3f3918..0d12d81 100644 --- a/extra/distract-the-trainers/solution.py +++ b/extra/distract-the-trainers/solution.py @@ -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), ]