It seems the system checks the linked list when judging the answer. If there is a loop in the list, there will be a Time Limit Exceed error.
For example, if you reverse the second half of the list a=>b=>c=>NULL, there will be two result:
- a-->b--><--c (b's next is c and c's next is b)
- a-->b-->NULL and c-->b-->NULL (b's next is NULL while a,c's next is b)
Note that, the first result does not prevent you from getting a correct result, as long as you record the length of the original list and know where the mid point is, and stop checking at mid point.
However, the code will have Time Limit Exceed error if you build a list like 1, though your answer is right. This is really misleading.