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.
Fixed! (Only took 2 months)
My bad,
[[1,2],[0,2],[1,2]]
should actually be[[1,2],[0,2],[0,1]]
That
[[1,2],[0,2],[1,2]]
is indeed connected, and if you ignore the node connected to itself, is also a tree.Also, you need to test not just for connectedness, but also if the graph is a tree or not.
[[1,2],[0,2],[0,1]]
is not a tree, because it contains the path0->1->2->0
I hope that clarifies things.
Added.
Once in a blue moon, there might be a tree that it says should be false, but that will happen extremly rarely, and can be fixed by simply trying again.
I think that's fixed.
The data type is much different, it is python, and also the graphs can be unconnected so you also need to check if the graph is connected.
Sorry about that, I think I fixed it.
This is my first kata, so I'm not really used to al of this.