Reverse all of the nodes that are present in the groups with an even number of nodes in them.
The nodes in the linked list are sequentially assigned to non-empty groups whose lengths form the sequence of the natural numbers ( 1 , 2 , 3 , 4... ) (1,2,3,4...).
The length of a group is the number of nodes assigned to it.
In other words:
- 1st node forms the 1st group.
- 2nd and 3rd nodes form the 2nd group.
- Nodes 4, 5 and 6 for the 3rd group.
Return head of the resulting linked list.