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.
Your current solution seems to be correct now?
This comment is hidden because it contains spoiler information about the solution
Why do you think they are invalid? They are not invalid.
This comment is hidden because it contains spoiler information about the solution
Yeah, I suppose, I got it where the problem is, thanks
Remember that when you are stuck and do not know how to proceed, you can visit the
#help-solve
channel on Codewars Discord.You are reading the logs wrong, and the test case which your solution fails is not the one you think it fails. Your solution works correctly for
arr1=[121 144 19 161 19 144 19 11]
andarr2=[121 14641 20736 36100 25921 361 20736 361]
and tests consider your answer correct for this input. Your solution fails for another input, which you did not infer correctly.You can debug your solution further after adding these lines at the top of your solution:
Then you will see what arrays really are handled incorrectly by your solution.
Your issue is not a correct one. I am not saying that the kata is not confusing, but this does not change the fact that this issue is caused by wrong interpretation of the error.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
@Chrono79
The code is below under the spoiler
Your algorithm is obviously very wrong, and you should know that because your reasoning is probably something like "hey maybe this works" and "yeah seems to pass these five tests I tried" and then you promoted that to correct xD
But that's not why you're failing the tests, they might actually allow your incorrect algorithm. You are mixing up test cases. It doesn't help that the test output is very poor.
You're reading the logs wrong. The test with that input expects false.
Not a kata issue.
It is
There is an invalid test case in the golang version (basic cases):
The test with these input parameters expects the function to return true. However, the second array has an invalid value: instead of 36100, the array should contain 361 to expect true
The correct code cannot pass the tests because of this
@Matti762, thanks a lot!
Loading more items...