• + 0 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

    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`