Skip to content

Commit 33b4152

Browse files
authored
Update 092.Reverse-Linked-List-II.cpp
1 parent b8af917 commit 33b4152

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Linked_List/092.Reverse-Linked-List-II/092.Reverse-Linked-List-II.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class Solution {
2222

2323
ListNode* start_of_second = cur;
2424
ListNode* prev = NULL;
25+
ListNode* next = NULL;
2526
for (int i=m; i<=n; i++)
2627
{
27-
ListNode* next = cur->next;
28+
next = cur->next;
2829
cur->next = prev;
2930
prev = cur;
3031
cur = next;

0 commit comments

Comments
 (0)