Quora 店面

input: List list, int[] width
for example
[‘abcdefg’, ‘abc’, ‘abcde’],
[‘ab’, ‘abcde’, ‘abcd’],
[3, 3, 3]

abc | abc | abc
def | | de
ab | abc | abc
| de | d

follow up:
If only give you the total sum of each element in the width vector, how to find the vector of width which make the output lines minimum?