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.
No it didn't work by brute force, but I'm close, it timeouts after 80% of completion. What I am doing is converting the string to an array because it's more convenient to work with and this takes time. Perhaps if I work directly in the string, I could win some performance enough to pass the tests?
This comment is hidden because it contains spoiler information about the solution
Hey guys I am solving this problem without the use of dynamic problem. This kata needs a fix since no dynamic programming is required and it is tagged as dynamic programming.
This approach scan an array three times in
includes
,
filterand
some`.check my approach which scan just two times.
https://www.codewars.com/kata/reviews/538abed5e62c874e1b0000f5/groups/6480cf7d45a05700012deaa9
how is suppossed to have access to the matrix of connections? with just 'a' and 'b' should we get the result?
at this moment the top solution is that by fengma1992. But it makes use of a simple aritmetic operations which in my opinion is cheating. The problem is tagged as 'graph theory', so something close to that is done in my solution since we do a search of diferent paths to find is there is one that cacth the mouse.
This comment is hidden because it contains spoiler information about the solution
And what is the complexity of solving with recursion than solving with a loop such as my soluction? I think this approach is shorter in code but memory complexity is O(n). using a loop solution memory complexity is O(1)
I disagree with this solution but it seems to be that you are other other algorithms not yours.