Reverse Nodes in k-Group

You are given the head of a singly linked list and an integer k.

Reverse the list in consecutive blocks of exactly k nodes:

  • If a block has exactly k nodes, reverse the order of nodes inside that block.
  • If the remaining nodes at the end are fewer than k, keep them in their original order.
  • You may only rearrange node links. Do not change node values.

Return the head of the updated linked list.

Examples
Input: [[1,2,3,4,5],2]
Output: []
Hints

Reverse Nodes in k-Group

You are given the head of a singly linked list and an integer `k`.