Is the space complexity here O(n)? Since if k increases by 5, my variable p would also increase by 5.

All this method does right now is get the node at k. For example: 1->5->3, when k = 2, the node is 5. 

```
public ListNode reverseKGroup(ListNode head, int k) {
    int p = 1;

    while (p < k) {
        if (head.next == null) {
            return head;
        }
        head = head.next;
        p++;
    }

    return head
}

```