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.
wow! i've thought of this (recursive) but have no idea how to pull this out :D
ncarenza is correct.
[[]].length = 1; [].length = 0
so[[]]
is not an nxn matrix.1X1 = [[1]], [1]
0X0 = [[]]
Since it's a square matix you could get the size with the array inside. Good look!
I agree and understand the intent it's just that some katas', as you mentioned, have a vague description and as a non-native english speaker, I sometimes guess what they want me to do. But I think it's still a nice feature to have, as a newbie programmer, I still have a lot to understand especially when some of the kata's test specs are very tricky that I haven't even experienced and will not really understand what I did wrong.
This is an intended feature. Knowing the tests would make you directly aware of some of the complexities you wouldn't have thought off otherwise.
I can undertand your request, but I think the idea behind code katas and codewars is not to provide software specs so you comply to them, but to force you to write rather generic code that would hold against sneaky edge cases you might not have thought of.
Of course the success of this approach is debatable, as I see some katas where people do just that: write something that complies to the test and that would be a dreadful piece of code to use in enterprise software.
Maybe the issue lies more with the kata's description than with the tests. I think it's a judgment call, and it'd be hard for them to make it work both ways. It's just too bad that some katas try to have you guess while others try to enforce specs that sometime seem silly.
Knowing what the specs of the test is. Sometimes when I try to submit my solution, it's failing on some tests and I don't know what should I change in my code.
For every random-reliant test case, there should be a functoin that measures the distribution of randomness. E.g. right now I'm working on ensuring a sample of string permutations is random for a kata.
nice use of the
~
operatorAn API to include my progress as a part of my online resume.
i feel like that is a 1x0. the length of the first dimention is 1. wouldn't a 0x0 be modeled as []?
Yes, you're right, that's a test case, it's nxn, both empty.
I have a feeling one of your test cases is
snail([[]])
instead ofsnail([])
. Is that still considered an nxn?