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.
Fixed.
Just wow, clever & efficent approach!
Nice!
This comment is hidden because it contains spoiler information about the solution
Nice, cleaner than mine. I had one more capturing group that I now see I didn't need.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
PHP test only throws:
Parse error: syntax error, unexpected '<', expecting end of file in /home/codewarrior/run.php on line 10
before my function is even called.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
iykyk...
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.
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.Loading more items...