piyushsharma220699 / LeetCode-Problems-Solution-Book

REPOSITORY EXCLUDED FROM HACKTOBERFEST 2021, CHECK THIS : https://github.com/piyushsharma220699/Hacktoberfest-2021/issues/261
https://hacktoberfest.digitalocean.com/
MIT License
37 stars 98 forks source link

25. Reverse Nodes in k-Group #161

Open pshivesh8 opened 2 years ago

pshivesh8 commented 2 years ago

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes, in the end, should remain as it is. You may not alter the values in the list's nodes, only nodes themselves may be changed.

Example 1: Input: head = [1,2,3,4,5], k = 2 Output: [2,1,4,3,5] image

pshivesh8 commented 2 years ago

I want to solve this in C++, Please assign this issue to me as a part of hacktoberfest-2021

piyushsharma220699 commented 2 years ago

@pshivesh8 Assigned in C++