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.
That's incredibly obvious in hindsight. Immediately able to fix after doing so, thank you.
By the way, if you just put
print
statements that show the arrays at the beginning, you might start to understand why your code is failing. Putting them inside conditionals only is a terrible way to debug your code, because you don't always know whether the input you're suspecting is actually the one that's causing problems.I didn't look exactly into your code, but I can tell you it's not correct, because the tests are trash. Your code fails 1 test, but it should fail many more.
This comment is hidden because it contains spoiler information about the solution
But there is no issue. The initial comment is just a lie/fabrication. There is only one test with 2 empty arrays, and the expected result is
True
. Both your and OP's solutions returnFalse
for such inputs, so I'd suggest fixing that part first.I have the same issue.
That's not the test you're failing. You're failing a test with 2 empty arrays.
Consider adding something like this at the start of function:
Not a kata issue.
I've logged tests after my initial if statements.Both evaluate to true for the lists being empty,
so naturally I return False. I'm getting "False should equal True", but how can any other
test conditions be satisfied if there are no lists? 114/115 tests passed, only one failing.
Also, a fair few other tests have passed which have the same logs. I'm baffled.
Great commented advice, really useful for someone my skill level. Especially since I did all the unnecessary things you mentioned.