Find the Width of Columns of a Grid
|
|
Explanation
- This code finds the absolute value of each integer to calculate its length and adds 1 if the integer is negative.
- This gives the correct widths of the columns, such as
[3, 1, 2]
forgrid = [[-15,1,3],[15,7,12],[5,6,-2]]
.