###19. Remove Nth Node From End of List

题目： 

<https://leetcode.com/problems/remove-nth-node-from-end-of-list/>


难度: Easy


AC击败了95.80%的Python用户，技巧 dummy head 和双指针。


```
class Solution(object):
    def removeNthFromEnd(self, head, n):
        """
        :type head: ListNode
        :type n: int
        :rtype: ListNode
        """
        dummy = ListNode(-1)
        dummy.next = head
        p = dummy
        q = dummy
        
        for i in range(n):
            q = q.next
            
        while q.next:
            p = p.next
            q = q.next
        
        p.next = p.next.next
        return dummy.next
            
```




