Ad
  • Default User Avatar

    That's incredibly obvious in hindsight. Immediately able to fix after doing so, thank you.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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 return False for such inputs, so I'd suggest fixing that part first.

  • Default User Avatar

    I have the same issue.

  • Custom User Avatar

    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:

    echo "\n--------------\n";
    var_dump($a1);
    var_dump($a2);
    

    Not a kata issue.

  • Default User Avatar

    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.

  • Default User Avatar

    Great commented advice, really useful for someone my skill level. Especially since I did all the unnecessary things you mentioned.