Find the nth node from the end of a Linked List using Python and hash table
<p>I am just beginning learning Data Structures and Algorithms. I am using the &quot;Data Structure and Algorithmic Thinking with Python&quot; book by Narasimha Karumanchi(CareerMonk).</p>
<p>On the topic of linked lists, one of the exercise question is to find the nth node from the end of a linked list. The author mentions that using a hash table is a better solution than brute forcing it.</p>
<p><a href="https://i.stack.imgur.com/4EFNJ.jpg" rel="nofollow noreferrer">Screenshot from the book</a></p>
<p>The author has left the implementation out. I am wondering how will I code this in Python as a class method or a function. I mean, it is relatively easy to get the memory address in C/C++ but I don't know how to construct the hash table(dictionary) as the author suggests in the book.</p>
<p>Can anyone help?</p>
<p>Thanks</p>