input: 
  def merge_sort(A, B):
      """
      This function takes two large lists A and B, and performs a merge-like sorting operation.
      It compares the elements of A and B one by one, adding the smaller element to the result list
      and moving the corresponding pointer forward. This continues until all elements from both lists
      are processed. The remaining elements from the list that still has unmatched elements are then
      appended to the result list.
      >>> merge_sort([3, 6, 8, 10, 11], [2, 5, 7, 12])
      [2, 3, 5, 6, 7, 8, 10, 11, 12]
      """
      result = [] 
      i, j = 0, 0
  
      # Compare elements and add lower one to result
      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
  
      # Add remaining elements
      result += A[i:]
      result += B[j:]
  
      return result
  
  # Test the algorithm
  A = [3, 6, 8, 10, 11]
  B = [2, 5, 7, 12]
  
  print(merge_sort(A, B))
  # Output: [2, 3, 5, 6, 7, 8, 10, 11, 12]
  
output:     
      result = [] 
      i, j = 0, 0
  
      # Compare elements and add lower one to result
      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
  
      # Add remaining elements
      result += A[i:]
      result += B[j:]
  
      return result
  