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.
This comment is hidden because it contains spoiler information about the solution
In Python, dataclass refers to a specific builtin library: https://docs.python.org/3/library/dataclasses.html
It can be confusing to mention it here.
I think this is supposed to say "the provided lists should not be modified" as lists are provided by-reference in Python and therefore can be accidentally changed.
Wasn't this done intentionally to ensure that MList returns MList?
I'm not entirely sure why this was based on producing an ordered list instead of a set either, I think maybe the author wasn't aware of sets in Python.
We know MList implements list, so:
will force it to use
list.__eq__
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The wording in this could maybe do with some rethinking. Instead of saying the sequence is graph-like, perhaps change the wording to something like:
Write a function which determines if the provided sequence of vertex degrees can be represented by a simple graph.
this introduces the idea of a simple graph up front instead of bringing it in later.
Now instead of going through the proxy of graph-like, we can directly explain what a simple graph is:
A simple graph is a graph without any loops (a vertex with an edge linking back to itself) and without multiple edges between any two vertices. A sequence of degrees can be represented by a simple graph if there exists any graph which satisfies these properties with the provided vertex degrees.
After front-loading that explanation we can then move on to demonstrating this:
(However I've never written a Kata before so take this suggestion with a grain of salt)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
1 = 0001
4 = 0100
5 = 0101
2 = 0010
5 = 0101
7 = 0111
3 = 0011
6 = 0110
7 = 0111
Loading more items...