public ListNode reverseKGroup(ListNode head, int k) {
        int length = this.getLength(head);
        if(k<=1 || length <=1 || k>length){return head;}
        if(k>=2){
        	ListNode temp = head.next;
            head.next = temp.next;
            temp.next = head;
            head = temp;
            k-=2;
        }
        ListNode currNode = head;
        ListNode nextNode = head.next;
        while(k>0){
            ListNode temp = nextNode.next;
            nextNode.next = temp.next;
            temp.next = currNode;
            currNode = temp;
            k--;
        }
        return currNode;
    }