I've come across the following question recently during my onsite interview,
Consider an online editor like Google Docs and consider a table which is of 1x2 size. Given input string consider like,
["leet code community discuss forum", "data structure and algorithm questions and patterns"]
The first string should fit within first coloum in the 1x2 table and the second string should fit within second column of the table.
Constraints:
With these constraints in mind, how would you split the column (c1 + c2 = line_length) so that the input strings can fit in minimum number of rows?
How can we solve this?