reverse a linked list from position m to n. do it in-place and in one-pass.
for example:
given <code>1->2->3->4->5->null</code>, m = 2 and n = 4,
return <code>1->4->3->2->5->null</code>.
note:
given m, n satisfy the following condition:
1 ≤ m ≤ n ≤ length of list.
因此,只需将m到n部分翻转,然后将m的前缀beforem指向该部分反转后的头结点即可。如果beforem为null,则m=1,m到n部分的头结点即为链表的头结点。