@@ -0,0 +1,1352 @@
+package leetcode;%0A%0A/**%0A * https://oj.leetcode.com/problems/reverse-linked-list-ii/%0A */%0Apublic class Problem92 %7B%0A    public static class ListNode %7B%0A        int val;%0A        ListNode next;%0A%0A        ListNode(int x) %7B%0A            val = x;%0A            next = null;%0A        %7D%0A    %7D%0A%0A    public ListNode reverseBetween(ListNode head, int m, int n) %7B%0A        int i = 1;%0A        ListNode left = null;%0A        for (ListNode node = head; node != null; node = node.next) %7B%0A            if (i+1 == m) %7B%0A                left = node;%0A                i++;%0A            %7D else if (i == m) %7B%0A                ListNode right = null;%0A                ListNode prev = null;%0A                ListNode current = node;%0A                while (i++ %3C= n) %7B%0A                    ListNode next = current.next;%0A                    current.next = prev;%0A                    prev = current;%0A                    if (right == null) %7B%0A                        right = current;%0A                    %7D%0A                    current = next;%0A                %7D%0A                if (right != null) %7B%0A                    right.next = current;%0A                %7D%0A                if (left != null) %7B%0A                    left.next = prev;%0A                %7D else %7B%0A                    head = prev;%0A                %7D%0A            %7D else %7B%0A                i++;%0A            %7D%0A        %7D%0A        return head;%0A    %7D%0A%7D%0A

Solve problem 92