主要思路:把多段链表反转,转化为一段一段处理 typedef struct ListNode { int val; struct ListNode* next; }ListNode; class Solution { public: ListNode* reverseKGroup(ListNode* head, int k) { if(head == NULL) //头部为空直接返回 { return head; } ListNode* p = new ListNode(0); //哨兵节点计算链表长度 p->next = head; int n = 0, re, s = 0; whil...