input: Write a python function to merge two sorted linked lists into one sorted linked list.
  assert print_linked_list(merge(create_linked_list([1, 3, 5]), create_linked_list([2, 4, 6]))) == "1 -> 2 -> 3 -> 4 -> 5 -> 6"
  assert print_linked_list(merge(create_linked_list([1, 3, 5, 7]), create_linked_list([2, 4, 6]))) == "1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7"
  assert print_linked_list(merge(create_linked_list([5, 10, 15]), create_linked_list([2, 3, 20]))) == "2 -> 3 -> 5 -> 10 -> 15 -> 20"
output: class ListNode:
      def __init__(self, val=0, next=None):
          self.val = val
          self.next = next
  
  def create_linked_list(lst):
      dummy = ListNode()
      curr = dummy
      for value in lst:
          curr.next = ListNode(value)
          curr = curr.next
      return dummy.next
  
  def print_linked_list(node):
      if not node:
          return ""
      result = []
      while node:
          result.append(str(node.val))
          node = node.next
      return " -> ".join(result)
  
  def merge(l1, l2):
      dummy = ListNode()
      tail = dummy
  
      while l1 and l2:
          if l1.val < l2.val:
              tail.next = l1
              l1 = l1.next
          else:
              tail.next = l2
              l2 = l2.next
          tail = tail.next
  
      if l1:
          tail.next = l1
      elif l2:
          tail.next = l2
  
      return dummy.next