I don't know why it reports "time limited exceed" as I think time complexity is O(n)

My code：

```
void reorderList(ListNode *head) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
if(head!=NULL){
vector<ListNode*> ln; // store listnode into vector
ListNode *p=head;
while(p!=NULL){
ln.push_back(p);
p=p->next;
}
int l=ln.size()-1; // from end
int i=0; // from begin
while(i!=l&&l-i!=1){ // reorder
ln[i]->next=ln[l];
ln[l]->next=ln[i+1];
i++;l--;
}
}
}
```