input: Write a function that merges two sorted lists A and B into a single sorted list. The function should compare the first element of list A with the first element of list B. If the element from A is greater, it should add the element to the result list and move the pointer of B to the next element. If the element from A is smaller, the pointer of A should move to the next element. The process continues until all elements from both lists are added to the result list.
  
  def merge_sort(A, B):
      result = []
      i, j = 0, 0
  
      while i < len(A) and j < len(B):
          if A[i] < B[j]:
              result.append(A[i])
              i += 1
          else:
              result.append(B[j])
              j += 1
  
      result += A[i:]
      result += B[j:]
  
      return result
  
  A = [3, 6, 8, 10, 11]
  B = [2, 5, 7, 12]
  assert merge_sort(A, B) == [2, 3, 5, 6, 7, 8, 10, 11, 12]
  
  A = [1, 3, 5, 7]
  B = [2, 4, 6, 8]
  assert merge_sort(A, B) == [1, 2, 3, 4, 5, 6, 7, 8]
  
  A = [1, 2, 3]
  B = [4, 5, 6]
  assert merge_sort(A, B) == [1, 2, 3, 4, 5, 6]
  
  A = []
  B = [1, 2, 3]
  assert merge_sort(A, B) == [1, 2, 3]
  
  A = [1, 2, 3]
  B = []
  assert merge_sort(A, B) == [1, 2, 3]
output: def merge_sort(A, B):
      result = []
      i, j = 0, 0
  
      while i < len(A) and j < len(B):
          if A[i] < B[j]:
              result.append(A[i])
              i += 1
          else:
              result.append(B[j])
              j += 1
  
      result += A[i:]
      result += B[j:]
  
      return result