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.
Thought I'll add a time complexity analysis since I couldn't find one posted here(or maybe I've missed it):
If we assume T(n) is the time complexity for solving the problem of size n(n * n matrix), we have the following recursion:
T(n) = n * (T(n-1) + n^2)
Basically we have n problems of size n-1 and also n^2 to construct the matrix for each sub problem.
Expanding the above we have:
T(n) = n * T(n-1) + n^3
which gives us
T(n) = n^n
What do you guys think?