class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { // write code here stack<ListNode*> s; ListNode* p = head; ListNode* cur, pre; while (p) { s.push(p); p = p->next; } for(int i=0;i<n;++i){ s.pop(); if(s.empty()) return head->next; pre=s.top(); } for (ListNod...