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.
So probably the confusion comes from wording used by kata description. You read "tail" as a tail of a list (i.e. its last node), while description means the tail as "this loose end hanging out of the circular loop". I thought the image would be explanatory enough, but apparently it is not.
Another potentially confusing thing is that description says that there's always a tail, while in some cases it's possible to have only a loop, without a tail.
I will think how to make the description less confusing, and if you have any proposal for wording, let me know.
What exactly is a tail in the case of
node == node.next
, is there some 'tail' that points to anode
that this functions starts with?Or are we always starting at the start of a linked list?.
If so how many elements has a tail in the case of
node == node.next
and how many has a loop? Well from the solution the amount of elelemtns in this loop is 1, therefore tail has 0 elements, so is there always a so called tail?Also starting Node A (picture) is a head of a linked list so how it is a part of a 'tail' which from what I understand should refere to a end of a linked list (null, None etc.) in this case the linked list has no end- therefore there is no tail.
How exactly is this confusing?
Such situation happens when the loop consists just of a single node. Do you mean that such tiny loops can be confusing?
It doesn't matter for a solution, but the description might be misleading for a lot of people since in some cases node == node.next.
Most beautiful solution for a problem I have ever seen (46 katas so far).
Add this list to the test [2, -3, 3] as my first solution doesn't work for that yet I passed this Kata.