Demohack2022 / hacktoberfest2022

HacktoberFest Contribution Repo
https://github.com/Demohack2022/hacktoberfest2022
MIT License
8 stars 61 forks source link

code for reversing nodes in k groups of LL #72

Closed joyeta148 closed 1 year ago

joyeta148 commented 1 year ago

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

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