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.
It just doesn't work like that... There's no magic here. Maybe the last assertion text is with
nil
arrays and they don't get displayed in console (IDK how go handles that). I edited your code and it works, you just need to read what error messages tell you and react to them.As a little hint: you can replace 6
if
statements at top with 2: 1 that deals with nil values and 1 that deals with different array lengths. Good luck.no: {2, 2, 3} => {2x2, 2x2, 3x3} => {4, 4, 9} != {4, 9, 9}
This comment is hidden because it contains spoiler information about the solution
I've tryed return true when the both at the same time are empty - but than it ask return false, and when i return false - it ask to return true
I dont understand what to do
You could've replied to your original question... Now there's massive wall of text, which no one likes to see :/
The problem with your code is how you're handling cases when 2 arrays are empty or when 1 array is empty and other one isn't. You should remove most of those
if
blocks at the top and rewrite them to cover all scenarios, you're almost there. (you can do that in 1 or 2 lines max)And by the way, 2 empty arrays should return true.
This comment is hidden because it contains spoiler information about the solution
That test expects
false
, both in sample and final tests.Are you sure those arrays are not manipulated (before logging)? I don't really know Go, but I just solved it and tests seem fine.
This comment is hidden because it contains spoiler information about the solution
Hi @Rodhlann, the kata tests are fine. The issue tag should be reserved for when there is some problem with the kata. You could instead post as a question. The test you are referring to does expect
true
.I have a test scenario in Java where it appears that both the a and b arrays are empty when I try to log a[0] or b[0], which is being caught by my check for null/empty, and then failing because the test is expecting the output to be true. Am I missing something here? All other tests are passing.