(OP was solving in JavaScript)
your implementation of count() has a bug, it skips the last element of the list because your while(head.next) is not entered for the penultimate element. not a kata issue.
count()
while(head.next)
Happened to me as well. I got around it by pushing a 3 to the LL in my solution
Same issue here
Thanks for the feedback, the kata description has been updated.
Loading collection data...
(OP was solving in JavaScript)
your implementation of
count()
has a bug, it skips the last element of the list because yourwhile(head.next)
is not entered for the penultimate element. not a kata issue.Happened to me as well. I got around it by pushing a 3 to the LL in my solution
Same issue here
Thanks for the feedback, the kata description has been updated.