input: from typing import List
  
  def transpose(A: List[List[int]]) -> List[List[int]]:
      """
      Transpose the given 2d array, A, and store the result in a new array, B.
      
      >>> transpose([[1, 2, 3], [4, 5, 6]])
      [[1, 4], [2, 5], [3, 6]]
      
      >>> transpose([[1, 2], [3, 4], [5, 6]])
      [[1, 3, 5], [2, 4, 6]]
      """
output:     B = []
      for i in range(len(A[0])):
          row = []
          for j in range(len(A)):
              row.append(A[j][i])
          B.append(row)
      return B