Copy List with Random Pointer - Leetcode 138 - Linked Lists (Python)

preview_player
Показать описание


Please check my playlists for free DSA problem solutions:

My Favorite Courses:

Data Structures & Algorithms:

Python:

Web Dev / Full Stack:

Cloud Development:

Game Development:

SQL & Data Science:

Machine Learning & AI:
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

Was able to do this in O(1) space complexity by pointing original node's next to new node. And we can go back and forth

TheResponsibleDude
Автор

I was able to solve this one by myself but I like your solution a lot more, thanks for sharing!

christianjt
Автор

why return old_to_new[head] hash map not the new_node you just create?

GarouNguyen