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.
I had change one's mind problem using the dynamic programming method, all tests passes except the very big square, with what it can be connected?
The problem with this approach is that you're calculating the cost of every possible path in the matrix. As you can imagine, that is quite a lot of possibilities. There is a much smarter way solve this problem, that gives you a running time of O(n^2) if the matrix is quadratic (Hint: Dynamic programming).
I have the same problem and i think my code is efficient because i use recursion to go trough all possible paths and storing the total sum in a list, at the end i return the smallest element of the list. Does it still have to be more efficient? Or is it probaby because i use a global list to solve the problem? (i'll put the code as a reply to this msg marked as spoiler)
The tests have been made in a way that requires you to come up with an implementation that runs pretty fast. (Hint: dynamic programming)
Solved this problem, using recursion, my computer thinks everything is fine, and in tests does not pass due to the delay more than 12 seconds, help you how to send a decision?