Skip to content

Commit 483e032

Browse files
committed
Update KwonNayeon.py
1 parent 3cb2592 commit 483e032

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

reverse-linked-list/KwonNayeon.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]:
3939
prev = None
4040
curr = head
4141

42-
# 마지막 노드도 처리해야 함
42+
# while문 조건 - 마지막 노드도 처리해야 함
4343
while curr:
4444

4545
temp = curr.next
4646
curr.next = prev
47+
48+
# prev: 지금까지 뒤집어진 부분의 시작점
49+
# curr: 아직 처리 안 한 부분의 시작점
4750
prev = curr
4851
curr = temp
4952

0 commit comments

Comments
 (0)