Angad Sandhu
Search
Browse

25_Reverse_Nodes_in_k-Group

Source name
25_Reverse_Nodes_in_k-Group.py
# File: Leetcode/Solutions/25_Reverse_Nodes_in_k-Group.py

"""
Problem Number: 25
Problem Name: Reverse Nodes in k-Group
Difficulty: Hard
Tags: Linked List, Recursion, Neetcode 150
Company (Frequency): Amazon, Apple, Facebook, Google, Microsoft
Leetcode Link: https://leetcode.com/problems/reverse-nodes-in-k-group/description/

DESCRIPTION

Given the `head` of a linked list, reverse the nodes of the list `k` at a time, and return the 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 they are.

You may not alter the values in the list's nodes, only the nodes themselves may be changed.
"""

Browse the library