input: Write a function to merge two sorted lists and return a new sorted list containing all the elements from both lists.
  def merge_sorted_lists(listA, listB): 
      merged_list = []
      ptrA = 0
      ptrB = 0
      while ptrA < len(listA) and ptrB < len(listB): 
          if listA[ptrA] <= listB[ptrB]: 
              merged_list.append(listA[ptrA]) 
              ptrA += 1
          else: 
              merged_list.append(listB[ptrB]) 
              ptrB += 1
      while ptrA < len(listA): 
          merged_list.append(listA[ptrA]) 
          ptrA += 1
      while ptrB < len(listB):
          merged_list.append(listB[ptrB])
          ptrB += 1
      return merged_list
  
  assert merge_sorted_lists([2,4,6], [3,5,7]) == [2,3,4,5,6,7] 
  assert merge_sorted_lists([1,3,5], [2,4,6]) == [1,2,3,4,5,6] 
  assert merge_sorted_lists([5,6,7], [1,2,3,4]) == [1,2,3,4,5,6,7] 
  assert merge_sorted_lists([], [1,2,3]) == [1,2,3] 
  assert merge_sorted_lists([1,2,3], []) == [1,2,3]
output: def merge_sorted_lists(listA, listB): 
      merged_list = []
      ptrA = 0
      ptrB = 0
      while ptrA < len(listA) and ptrB < len(listB): 
          if listA[ptrA] <= listB[ptrB]: 
              merged_list.append(listA[ptrA]) 
              ptrA += 1
          else: 
              merged_list.append(listB[ptrB]) 
              ptrB += 1
      while ptrA < len(listA): 
          merged_list.append(listA[ptrA]) 
          ptrA += 1
      while ptrB < len(listB):
          merged_list.append(listB[ptrB])
          ptrB += 1
      return merged_list