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.
On god
Should be 7 kyu;
can this code be considered as idiomatic C#?; considering todays standards.
sewY
Yes, thanks for your reply, as far as I know a zipper or a tagging is an approach to create unique identifiers for nodes, but the problem was that I could not wrap my head around how to implement either one when the list contains a cycle. I get now that I should not have thought about the numbers inside nodes as values but as tagging(enumeration), but, by convention, is it not a value that goes inside the circle while it's representing a node? Anyway, it left me wondering, if those numbers were to represent values, how would I implement an identifier for a node(nodes are cycled by 'Tying the Knot'), that's something I will look into.
Thing is, the general idea here is that nodes do not necessarily have to hold any values, and if they do, the values do not necessarily have to be unique. The important part is identity of nodes. The image does not mean to show that nodes hold values, and in many languages they don't. All what is needed to solve this problem is check of "is this node the same node as the other node" which is easy to do in languages with references, but in Haskell, translator decided to go with an implementation of
Eq
for nodes backed by an internal, non-public, and deliberately undocumented identifier. All what you can do, and all what is actually needed to solve the task, isnode1 == node2
, which returnsTrue
ifnode1
andnode2
hold the same node, andFalse
if not.I do not know if it is a good, idiomatic approach for Haskell. It might be, or might be not, no idea. But the idea is that all you need to know to solve the task is equality of nodes, and not values held by the nodes.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm sorry for your time, but I'm also glad you liked it. :)
I used my precious time to understand this.
worth it
smart boi