input: Write a python function to convert an array to a singly linked list.
  assert arrayToList([22, 7, 34, 15]).val == 22
  assert arrayToList([22, 7, 34, 15]).next.val == 7
  assert arrayToList([22, 7, 34, 15]).next.next.next.val == 15
output: class ListNode:
      def __init__(self, val=0, next=None):
          self.val = val
          self.next = next
  
  def arrayToList(arr):
      if not arr:
          return None
      head = ListNode(arr[0])
      current = head
      for value in arr[1:]:
          current.next = ListNode(value)
          current = current.next
      return head