table has to be printed in neat columns. The width of a number is the count of characters in its decimal form, with the minus sign of a negative number counted too (-15 has width 3). The width of a column is the largest width among its numbers.
Return an array whose j-th element is the width of column j.table=[[7, -120], [4500, 3], [-8, 66]] → [4, 4]
In the first column the widest number is 4500, at 4 characters. In the second, -120 takes 4 characters including the minus sign.
table=[[0, 0, 0]] → [1, 1, 1]
Zero is written with a single character.
table=[[-1], [10]] → [2]
table=[[7, -120], [4500, 3], [-8, 66]]
[4, 4]
Run checks the first 3 tests in your browser. Submit checks all 92 tests on the server, hidden ones included.