input: def merge_sort(A, B):
      """Merge two sorted lists A and B into a single sorted list. 
      The algorithm should compare the first element of A with the first element of B.
      If the element of A is greater than the element of B, it should add the element of B to the result list and move the pointer of B to the next element.
      If the element of A is smaller, the pointer should move to the next element of A, and so on.
      
      >>> A = [3, 6, 8, 10, 11]
      >>> B = [2, 5, 7, 12]
      >>> merge_sort(A, B)
      [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
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