Skip to content

Commit 00274d3

Browse files
committed
Changed filename for 206. Reverse Linked List
1 parent 68cf22a commit 00274d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]:
3+
prev = None
4+
5+
while head != None:
6+
next = head.next
7+
head.next = prev
8+
prev = head
9+
head = next
10+
11+
return prev

0 commit comments

Comments
 (0)