public ListNode reverse(ListNode head, int len){
        ListNode prev = null;
        ListNode curr = head;
        while(curr != null && len > 0){
            ListNode next = curr.next;
            curr.next = prev;
            prev = curr;
            curr = next;
            len--;
        }
        return prev;
    }