We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I kinda hacked it I guess, by using self field. Though it happened cause I didn't watch the video and didn't understand what was required of me and why my intuitional approach yielded result reversal to demanded
def insert(self, head, data):
node = Node(data)
if head is None:
self.prev = node
return node
else:
self.prev.next = node
self.prev = node
return head`
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 15: Linked List
You are viewing a single comment's thread. Return to all comments →
I kinda hacked it I guess, by using self field. Though it happened cause I didn't watch the video and didn't understand what was required of me and why my intuitional approach yielded result reversal to demanded