input: Write a function to format a two-dimensional array as a table. If the array is empty, return an empty string. The function should format each element in the table with padding based on the longest element in the corresponding column.
  def printTable(array):
      if not array:
          return ""
      col_width = [max(len(str(x)) for x in col) for col in zip(*array)]
      return "\n".join("  ".join(str(x).ljust(col_width[i]) for i, x in enumerate(row)) for row in array)
  
  assert printTable([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == "1  2  3\n4  5  6\n7  8  9"
  assert printTable([[1, 22, 333], [4, 55, 666]]) == "1  22  333\n4  55  666"
  assert printTable([[1], [2], [3]]) == "1\n2\n3"
  assert printTable([]) == ""
output: def printTable(array):
      if not array:
          return ""
      col_width = [max(len(str(x)) for x in col) for col in zip(*array)]
      return "\n".join("  ".join(str(x).ljust(col_width[i]) for i, x in enumerate(row)) for row in array)