暴力解 class Solution { public: bool isPalindrome(ListNode* head) { vector<int>v; bool out=0; while(head){ v.emplace_back(head->val); head=head->next; } int n=v.size(); for(int i=0;i<n/2;i++){ if(v[i]!=v[n-i-1])return 0; } return 1; } };