input: Write a function to format a two-dimensional array as a table. The function should find the longest string in each of the inner lists and format the output accordingly. The function should return the formatted table as a string.
  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], [44, 5, 66], [7, 88, 999]]) == "1   22  333\n44  5   66 \n7   88  999"
  assert printTable([[1, 2, 3], [4, 55555, 6], [7, 8, 9]]) == "1    2     3\n4    55555 6\n7    8     9"
  assert printTable([]) == ""
  assert printTable([[1], [2], [3]]) == "1\n2\n3"
output: def printTable(table):
      if not table:
          return ""
      
      col_widths = [max(len(str(item)) for item in row) for row in zip(*table)]
      formatted_rows = []
      
      for row in table:
          formatted_row = ' '.join(str(item).ljust(col_widths[i]) for i, item in enumerate(row))
          formatted_rows.append(formatted_row)
      
      return '\n'.join(formatted_rows)