input: Write a python function to split a linked list into two halves.
  assert splitList(head1) == (expected_head1_first_half, expected_head1_second_half)
  assert splitList(head2) == (expected_head2_first_half, expected_head2_second_half)
  assert splitList(head3) == (expected_head3_first_half, expected_head3_second_half)
output: class ListNode:
      def __init__(self, val=0, next=None):
          self.val = val
          self.next = next
  
  def splitList(head):
      if not head or not head.next:
          return head, None
      
      slow = head
      fast = head
      prev = None
      
      while fast and fast.next:
          prev = slow
          slow = slow.next
          fast = fast.next.next
          
      prev.next = None  # Split the list into two halves
      
      return head, slow