...

```
public ListNode reverseBetween(ListNode head, int m, int n) {
ListNode dumy = new ListNode(Integer.MIN_VALUE);
dumy.next = head;
ListNode begin = dumy;
for (int i = 1; i < m; i++) {
begin = begin.next;
}
ListNode cur = begin.next;
for (int i = m; i < n; i++) {
ListNode temp = cur.next.next;
cur.next.next = begin.next;
begin.next = cur.next;
cur.next = temp;
}
return dumy.next;
}
```

...