def reverseBetween(self, head, m, n):
        diff, dummy, cur = m + 1 - n, ListNode(-1), head
        dummy.next = head
        
        last_unswapped = dummy
        while cur and m > 1:
            cur, last_unswapped, m = cur.next, cur, m - 1
            
        prev, first_swapped = last_unswapped,  cur
        while cur and diff > 0:
            cur.next, prev, cur, diff = prev, cur, cur.next, diff - 1
            
        last_unswapped.next, first_swapped.next = prev, cur
        
        return dummy.next
dataset/ETHPy150Open kamyu104/LeetCode/Python/reverse-linked-list-ii.py/Solution.reverseBetween/swapped operands of `-`