input: Write a python function to find the nth node from the end of a linked list.
  assert find_nth_from_end(linked_list, 1) == 5  # Given linked list is 1->2->3->4->5
  assert find_nth_from_end(linked_list, 2) == 4  # Given linked list is 1->2->3->4->5
  assert find_nth_from_end(linked_list, 3) == 3  # Given linked list is 1->2->3->4->5
output: class ListNode:
      def __init__(self, val=0, next=None):
          self.val = val
          self.next = next
  
  def find_nth_from_end(head, n):
      first = head
      second = head
      for _ in range(n):
          if first is None:
              return None
          first = first.next
      while first:
          first = first.next
          second = second.next
      return second.val
  
  # Helper function to create a linked list from a list of values
  def create_linked_list(values):
      if not values:
          return None
      head = ListNode(values[0])
      current = head
      for value in values[1:]:
          current.next = ListNode(value)
          current = current.next
      return head
  
  # Create the linked list 1->2->3->4->5
  linked_list = create_linked_list([1, 2, 3, 4, 5])
  
  # Test cases
  assert find_nth_from_end(linked_list, 1) == 5
  assert find_nth_from_end(linked_list, 2) == 4
  assert find_nth_from_end(linked_list, 3) == 3