It would eventually crash. Though, the problem desctiption states that there's always a loop, so I didn't include the null check in the while loop.
BTW: I didn't know that solution passed... if was failing on the last test (but only here on codewars for some reason).
EDIT: Please ignore my misplaced comment :)
Thanks! I'll give it another go.
The C version of the kata seems to be OK.
I think something is wrong with your solution.
Something is wrong (C). I get correct values for FourNodesWithLoopSize3, NoTail and TinyLoop on my PC, but these tests fail here for some reason...
Loading collection data...
It would eventually crash. Though, the problem desctiption states that there's always a loop, so I didn't include the null check in the while loop.
BTW: I didn't know that solution passed... if was failing on the last test (but only here on codewars for some reason).
EDIT: Please ignore my misplaced comment :)
Thanks! I'll give it another go.
The C version of the kata seems to be OK.
I think something is wrong with your solution.
Something is wrong (C). I get correct values for FourNodesWithLoopSize3, NoTail and TinyLoop on my PC, but these tests fail here for some reason...