input: Write a function to delete a node from a linked list at a specified position.
  assert str(deleteNode(create_linked_list([1, 2, 3, 4, 5]), 2)) == "1->2->4->5"
  assert str(deleteNode(create_linked_list([1, 2, 3]), 0)) == "2->3"
  assert str(deleteNode(create_linked_list([1]), 0)) == "None"
  assert str(deleteNode(create_linked_list([1, 2, 3, 4, 5]), 4)) == "1->2->3->4"
output: class ListNode:
      def __init__(self, val=0, next=None):
          self.val = val
          self.next = next
  
      def __str__(self):
          result = []
          current = self
          while current:
              result.append(str(current.val))
              current = current.next
          return '->'.join(result)
  
  def create_linked_list(arr):
      if not arr:
          return None
      head = ListNode(arr[0])
      current = head
      for val in arr[1:]:
          current.next = ListNode(val)
          current = current.next
      return head
  
  def deleteNode(head, position):
      if position == 0:
          return head.next
      current = head
      for _ in range(position - 1):
          if not current.next:
              return head
          current = current.next
      if current.next:
          current.next = current.next.next
      return head