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.
you know we had to do it to em
this kind of code hints that we don't have friends. wakarimasu
This is the only one that works on infinite strings.
L M A O
Not gonna lie, it was quite difficult
really elegant.
for those not familiar with ViewPatterns, you can find related information here: https://gitlab.haskell.org/ghc/ghc/-/wikis/view-patterns.
in the above program, it is used to bind "y" with "show x"
very creative
Cool, but it lets me realize that the problem should not accept O(VE) solutions , it should accept only O(V + E * log(V)) instead
Vertices are removed one by one independently in each branch of computation. I'm not ready to estimate the complexity without much thinking, but I'm afraid it might be worse than exponential. This is just 101 edges: https://www.codewars.com/kumite/5c7993bcb79f2e46ed9f9f17
very clever solution!
I got a question about
s == e
, does it mean that one could go from 'a' to 'a' even 'a' is not in the graph?Nope, It works in O(VE), where V - number of nodes, E - number of edges. Each time new node is visited all outgoing arcs are removed which requires traversing arc list, thus V times O(E) = O(VE)
Doesn't it have exponential time complexity?
hmmm, you solved this kata twice with the exact same solution?
This comment is hidden because it contains spoiler information about the solution
You can recover the meaning from the test cases. It's difficult to describe them without giving away exactly the implementation.
Loading more items...