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.
List<Character>
.assertEquals(list, list, msgWithInputs)
to have proper assertion messages.I will reject this translation for the above reasons. You are free to fix them by forking this translation.
Even though it is marked as 7-kyu, the tests are very challenging and have been sometimes unclear for me personally. I struggled with passing some of them and literally had to guess what they were asking for. It would be cool to update the visible tests a bit to better match the hidden ones. Anyway, thanks for this Kata!
B4B is right, your solution works incorrectly when it's run twice in a row.
It's a bug in your solution, not a kata issue.
Hi,
advise:
It's like a magic ))) now i passed all test except random. Most likely i change something and and now it work correct. Anyway thank you very much sir
Hey @nestormanjk - no worries for language, it is 2nd language for most users also :)
So from this screen shot, if I interpret the console log correctly it seems that the test your code is failing on is the last one in the console which is:
attackers = [51,28,13,15,2,14,58,61]
defenders = [95,47,42,53]
The correct answer for this is
false
(I checked using the kata reference solution) but it seems your code is returningtrue
(that's what the error message says): so can you check these inputs in your local computer also - do you getfalse
on local machine?@nestormanjk you have to be more clear when asking questions, right now it's hard to read if you think there's a problem with the tests or with your solution/kata logic.
I checked all the 3 cases you gave, and the correct answer (according to Python reference solution) is
True
for all of them.Maybe you are reading Tests/error messages incorrectly? :
Depending on which language you are working in (this is why you need to state it in your question) - if your error message is something like: "Expected false to equal true" it usually means that you are returning false and the correct answer is true for those inputs.
To be 100% sure before debugging more: first try the same tests in your local computer - put
attackers [1, 5, 3] defenders[2, 2, 6, 8]
into your solution and see if it returnstrue
(correct answer) orfalse
(incorrect answer) ??Thanks benjaminzwhite. :-)
Hi @romanBryndzak - I copied this test and note that 492 and 540 is just the sum of the respective arrays: are you just comparing the sum of the 2 arrays to find your answer??
If so, that is not what the kata is asking for (it would be a bit easy if so...). Re-read the description, the condition is more complex than that: you have to compare element-by-element, determine winner of each "battle", then add up the number of survivors etc.
Hi, people. I have a problem in start test.
assert.strictEqual(hasSurvived([32, 65, 21, 83, 85, 7, 71, 45, 20, 63], [83, 44, 38, 55, 84, 80, 58, 20, 4, 74]), false);
});
This test expects false but the result is 492 and 540, so this is true. Yes?
Thank you :D
Approved by someone
I have run its reference solution against a full compliment of tests extracted from the Python version. If there is any problem with the translation, I will be sure to see that they are promptly rectified. :0
Thanks for translating, I can't review the translation since I don't know about C but it seems to be working fine so I'll approve it if no one else reviews it :)
You can try training again and submitting the solution again, don't know if it'll work. But if your concern is whether or not it counts as completed, it does count, you wouldn't be able to see other people's answers if you didn't complete it, also it appears as completed in your profile.
Loading more items...