| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/feixiangcode/algorithm/master/Week_01/id_118/leetcode_25_118.java | [Back] [Original] |
/**
* https://leetcode-cn.com/problems/reverse-nodes-in-k-group/
*
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public ListNode reverseKGroup(ListNode head, int k) {
// 1. k1
if(head==null || head.next==null || k
| Web Proxy Viewer | New URL | Original Page |