Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    This list always contains a tail and a loop.
    ...in the following picture the tail's size is 3 and the loop size is 12:

    What exactly is a tail in the case of node == node.next, is there some 'tail' that points to a node 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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar

    Most beautiful solution for a problem I have ever seen (46 katas so far).

  • Custom User Avatar

    Add this list to the test [2, -3, 3] as my first solution doesn't work for that yet I passed this Kata.