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.
Yeah I agree if it were to be used in the real world it would probably be better and safer to do it iteratively and do some checks so it doesn't run forever. For these small kata I find it more fun to solve them in short and interesting ways though :)
In the example tests, "current list is %r"%r doesn't work. I honestly haven't used that syntax for string formatting in ages, I find that using the .format() string function a lot clearer as in: "current list is {0}".format(a)
This would actually be a really good problem to help people get comfortable with recursion. Recursion was the first way I thought of solving this, I didn't realize until after submitting and seeing the other solutions that there was a constant depth to the nesting.
I didn't realize that test cases can't be edited after publishing, which is unfortunate because it actually is well defined.
dim(a + b) = max(dim(a), dim(b))
This is because the vector space R^m is a subspace of R^n for all m <= n. For example, (1, 2) + (3, 4, 7) = (4, 6, 7) because (1, 2) = (1, 2, 0).
I don't think there should be a restriction on adding and subtracting vectors of different dimension, addition of vectors of diffent dimension is valid mathematically so why not here?