new_contents: # class ListNode(object):
  #     def __init__(self, x):
  #         self.val = x
  #         self.next = None
  
  class Solution(object):
      def removeNthFromEnd(self, head, n):
          """
          :type head: ListNode
          :type n: int
          :rtype: ListNode
          """
          dummy = ListNode(0)
          dummy.next = head
          first, second = dummy, dummy
          for i in xrange(n):
              first = first.next
          while first.next:
              first = first.next
              second = second.next
          second.next = second.next.next
          return dummy.next
  
subject: Create remove_nth_from_back.py