• + 0 comments

    This is Python Code using stack.

    def getNode(llist, positionFromTail):
        head = llist
        stack = []
        
        while head:
            stack.append(head.data)
            head = head.next
            
        for i in range(positionFromTail+1):
            final = stack.pop()
        
        
        return final