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.
"alr apporved some time ago"
Hi, I made a Python translation for this kata. Please approve it.
Why would it expect Arsenal in uppercase if the instruction said to return it in lower case if the max reminder is an even number. Here is the example below.
[ 56, 120, 119, 11, 20, 20 ]
16
Expected: ''ARSENAL'', instead got: ''arsenal''
I made a C# translation for this Kata.
There are solutions, like this one which should not pass as the upper bound of the length of a and b is not specified and potentially infinite.
My suggestion is to test bigger arrays of random size in the random tests.
Edit: Kata specifications say "The lengths of the first two arrays will be equal, and the integers will always be positive", but the last fixed test uses
[0, 0]
as an array.There are now 50 random tests.
The point here is actually rather that a good test suite should:
Failing to do the former properly is called a broken test. Failing to do the latter properly is still a broken test.
People often just think about the former without the latter, but of course, as we know, tests that let everything pass is useless.
Done. You are right. I still wonder, though, why do people cheat on CodeWars? I mean, what is the point? Isn't the whole idea to challange yourself and try to solve the problem?
Can we have more than one random test please? Like, fifty or so?
With a
for
loop that's not 50 times as much work, and it prevents hardcoded solutions. ( With just the one random test, a cheater has a 50% chance of being able to submit. Having to hit the Submit button, on average, twice is not a real deterrent to a would-be cheat. )Bugger. :P
Well, here's waiting for kata #3 then. I hope it'll have an own name as good as this one. :]
Indentation is whitespace from the left margin to the actual start of the line.
In general, you want to keep blocks of code indented consistently, so you can see at a glance what lines of code belong to the same block. If you open a new block, you increase the indent; if you close it, you decrease it.
This is your code, formatted according to one style of indentation ( there are more ):
So it's purely a formatting thing. But it makes well-structured code easier to read.
Note I have removed the enclosing curly braces from the bottom
if
; it's still immediately clear what statement(s) might be skippedif
the condition fails because it's indented from theif ()
statement.Your original code is not consistent in its indentation, and not all code inside a block is indented relative to the start of the respective block. The structure does not stand out as much as it might. So one has to actually read every line of code to understand it, and see the structure that way ( it's there, of course ). Your code is not as maintainable as it might be.
Does that answer your question?
Issues resolved, see the comment above.
Yep, you are rigth. Thanks for that feedback. Will now correct.
Typos on the description ...
-The first two will always be arrays consisting of intigers => integers
-Reminder instead of remainder
Thanks. Changed the name; there will be no kata #1; added an example test case; random test added; changed to 6kyu.
Loading more items...