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.
Hi, can you elaborate on what you mean by this is not allowed in real code? Are you meaning I wasn't supposed to do this for the challenge, or in production the original array must be left alone, or something else?
You're absolutely right — mutating the original array is not a good practice in production code.
In this case, I went for brevity over purity, since Codewars tests don't reuse the input array.
Thanks for the constructive feedback!
I'll keep it in mind for cleaner and safer code outside of kata environments.
I see, if the example in the description would have Johnny as the first value, it would fail.
You're right. The problem is in
includes(...dead)
, which only checks the first name in thedead
list. The current test cases likely miss this bug and should be updated.Because it works, why do you say it shouldn't?
Please do not post the same comments over different solutions as it gets spammy in the dashboard. If you want to dive deep into time complexity comparisons between different solution, kindly fork the solution with comments mentioning so ^^
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
why?
Thanks for your input. After reading I went to look into it and learned a lot and better practices. Thank you!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
can you please explain why for the benefit of people who are most likely new and don't realise the implications of this (or what mutating even means)
we are asked only those four operators, not "exponentiation"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Loading more items...