Skip to content

Leetcode 206 #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Algorithms/Easy/206_ReverseLinkedList/Solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Solution:
def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]:
prev = None

while head != None:
next = head.next
head.next = prev
prev = head
head = next

return prev
1 change: 0 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
<td align="center"><a href="https://github.com/IsratIJK"><img src="https://avatars.githubusercontent.com/u/74541103?v=4" width="100px;" alt=""/><br /><sub><b>Israt Jahan Khan</b></sub></a><br /><a href="https://github.com/Tahanima/leetcode-solution-curation/commits?author=IsratIJK" title="Contribution">📖</a></td>
<td align="center"><a href="https://github.com/Maqsud131"><img src="https://avatars.githubusercontent.com/u/9807475?v=4" width="100px;" alt=""/><br /><sub><b>MD. Maqsud ul Anwar</b></sub></a><br /><a href="https://github.com/Tahanima/leetcode-solution-curation/commits?author=Maqsud131" title="Contribution">📖</a></td>
<td align="center"><a href="https://github.com/JoyKrishan"><img src="https://avatars.githubusercontent.com/u/53441994?v=4" width="100px;" alt=""/><br /><sub><b>Joy Krishan Das</b></sub></a><br /><a href="https://github.com/Tahanima/leetcode-solution-curation/commits?author=JoyKrishan" title="Contribution">📖</a></td>
<td align="center"><a href="https://github.com/sahariardev"><img src="https://avatars.githubusercontent.com/u/16094847?v=4" width="100px;" alt=""/><br /><sub><b>Sahariar Alam Khandoker</b></sub></a><br /><a href="https://github.com/Tahanima/leetcode-solution-curation/commits?author=sahariardev" title="Contribution">📖</a></td>
</tr>
</table>