You are given a node that is the beginning of a linked list. This list always contains a tail and a loop.
Your objective is to determine the length of the loop.
For example in the following picture the tail's size is 3 and the loop size is 11.
// Use the `getNext()` method to get the following node.
node.getNext()
Note: do NOT mutate the nodes!
Thanks to shadchnev, I broke all of the methods from the Hash class.
Don't miss dmitry's article in the discussion after you pass the Kata !!
'매일매일개발 > Codewars' 카테고리의 다른 글
codewars #86 Remove Duplicates(7kyu) (0) | 2018.07.26 |
---|---|
codewars #85 Circularly Sorted Array (6kyu) (0) | 2018.07.25 |
codewars #83 Stop gninnipS My sdroW! (6kyu) (0) | 2018.07.23 |
codewars #82Evil Autocorrect Prank (6kyu) (0) | 2018.07.19 |
codewars #81 Format words into a sentence (6kyu) (0) | 2018.07.18 |