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.
Added.
Don't be sorry. Fixed!
This is an old kata, and consistency of tests and implementations was less regarded at that time. I don't think it is possible to change this without breaking old solutions, and in general the prevailing is opinion is to avoid it (breaking old and valid solution) as much as possible, for this reason one must cope with it.
I just added a LINQ based one liner solution that is 2D array compliant, with no extra methods/extensions, but I do have the same musing about the choice to use a 2D array; multidim arrays are usually a pain in the ass compared to jagged.. I was expecting the output to be [][] rather than [,]..
One option is to use C# to its fullest power and write a custom LINQ extension method that transforms any multidimensional array to a jagged one.
@hobovsky: My 2 cents: It's not just LINQ. There aren't that many languages with multidimensional array support like C#. The original kata and all other translations expect a jagged array as output. IMO the translation is not consistent with the original (and the other translations) without a good reason.(*) The output format limits the possible ways to solve this kata or forces using some unusual tricks.
(*) When C# supports jagged arrays and jagged arrays are the usual way, what is the point of using a construct specific to C# which is not consistent with the original?
¯\_(ツ)_/¯
Then I would say that this reasoning is backwards. Implementation should be driven by design, and not the other way round. Choosing an inferior interface only because it would allow you to use your favorite library is exactly reverse of how things should be done.
This is arguable. It would be also good to realize that Linq is just a tool and nothing else. It can be used where fit, and should not be used where it does not work.
I am not sure I understand the problem: all rows are of the same length, so the "rectangular" array seems a good fit? In a jagged array, you could have rows of different lengths, what does not make too much sense? If the table is always 10 rows long, and each row has 10 columns, then
int[10,10]
is better than an array of tenint[]
, each of potentially different length?Done, thanks!