input: 
  def merge_sort(A: List[int], B: List[int]) -> List[int]:
      """ Merge two sorted lists A and B into a single sorted list by comparing elements.
      Maintain two pointers i and j, starting at the first elements of A and B respectively.
      If the element from A is smaller, append it to the result list and move the pointer i.
      Otherwise, append the element from B and move the pointer j.
      Once all elements of one list are added, append the remaining elements of the other 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
      
      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
  
output:     
      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
  