Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
So unfortunately there is an easy way to break this and succeed at all of the tests:
def wpp(a, b, n):
if n > b and n > a:
return []
if (not a % 2 and not b % 2 and n % 2) or ((not a % b or not b % a) and not n % 2 and n < a and n < b):
return []
return [(n, min(a, b))]
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Honestly it feels like the point of this is to not use multiplication and iteration over what you are given, but that is just my interpritation. This is a great Kata if you work under that idea but it seems most others went about it as finding built ins or other functions to get around the restrictions rather than figruing out the math solution.
So I am passing all the sample tests and everything I do on my own end but it is throwing and index error any time I try and submit?