Skip to content

Commit ccbd0d5

Browse files
refactor 25
1 parent 731c958 commit ccbd0d5

File tree

1 file changed

+0
-17
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-17
lines changed

src/main/java/com/fishercoder/solutions/_25.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,6 @@
22

33
import com.fishercoder.common.classes.ListNode;
44

5-
/**
6-
* 25. Reverse Nodes in k-Group
7-
*
8-
* Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
9-
* k is a positive integer and is less than or equal to the length of the linked list.
10-
* If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
11-
* You may not alter the values in the nodes, only nodes itself may be changed.
12-
* Only constant memory is allowed.
13-
14-
For example,
15-
Given this linked list: 1->2->3->4->5
16-
17-
For k = 2, you should return: 2->1->4->3->5
18-
19-
For k = 3, you should return: 3->2->1->4->5
20-
*/
21-
225
public class _25 {
236

247
/**We use recursion to go all the way until the end: when the number of nodes are smaller than k;

0 commit comments

Comments
 (0)