input: Write a function to optimize a Python program that processes a 2d array and stores the transpose output in a new array. Given a 2D array A, the function should return the transposed array B.
  assert transpose([[1, 2, 3], [4, 5, 6]])==[[1, 4], [2, 5], [3, 6]]
  assert transpose([[1, 2], [3, 4], [5, 6]])==[[1, 3, 5], [2, 4, 6]]
  assert transpose([[1, 2, 3, 4], [5, 6, 7, 8]])==[[1, 5], [2, 6], [3, 7], [4, 8]]
  assert transpose([[]])==[[]]
output: def transpose(A):
      return [list(row) for row in zip(*A)]