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.
This comment is hidden because it contains spoiler information about the solution
I used "list" because I find that to be a bit less specific than "array" but I don't mind one way or another, I read them all in a language neutral manner.
@natan: sorry I have just made the change of "array" to "collection" following Bandit254. Do you agree with that?
Thanks for your proposal!
PS:
I agree with that all the more that the difficulty could be different from one langauge to another one.
I made an attempt at cutting things down a bit.
I'd ideally want complete neutrality but I understand that not all languages express input/output well in their types and that not everyone is so quick to look at the sample tests. Still, I think this is a fair bit less redundant without losing much. Obviously, having multiple versions by language is bad.
Can you translate this drawing into an algorithm?
You will be given two dimensions
length
width
You will return a list or a string depending on the language.
When the initial parameters are so that
length == width
, the solution[length]
would be the most obvious but not in the spirit of this kata so, in that case, returnNone
/Nothing
/nil
/null
/{}
/Array()
or in the case of C, its sz component should equal 0.length == width
as a starting case would be an entirely different problem and the drawing is planned to be interpreted withlength != width
. (See kata, Square into Squares. Protect trees! http://www.codewars.com/kata/54eb33e5bc1a25440d000891 for this problem).@g964 - that makes more sense now, thanks!
@g964 and @natan - if you want the description to reference a generic data structure, then wouldn't the term "collection" be a better choice? As in, "return a collection of the squares that can be made from the rectangle." Because the description currently reads "return an array or string", which causes the reader to focus on those two specific data types.
@Bandit254: I modified the tests so there are no more a difference between the "Solution" and the tests in C#.
It seems that more than 18,000 people understood that "array" here was a generic term. Moreover the examples show that it can refer to different structures depending on the language.
What do you propose to remove that "cruft"?
The kata description uses the word "array", but it isn't referring to any particular data structure in any particular language so you shouldn't interpret it as such.
I'd want to see the language specific cruft cleared out of the description because it's drowning out the description itself.
It is difficult to determine what data type you are supposed to return (list or array) because the instructions and test code say array, but the submission window has the return type as list. I would recommend changing the submission window to have the return type as array so that it's consistent with the rest of the intsructions/test code. Otherwise, I enjoyed this Kata
Ok, I see how I misinterpreted the prompt. I would recommend including a statement similar to "Note: Reversing the order of the bytes is not the same as simply reversing the given input array" to avoid confusion.
there ARE random tests already...
edit: I actually completely rewrote the tests anyway...
done
No, it will when Node version >= 11
Example tests are OK, and task is not about creating an exact reverse of input. Please read task description carefully, especially examples.
Resolving as not a kata issue.
Actual and expected are flipped for some tests python
Loading more items...