Back to problems

Two-Column Table: Place Divider to Minimize Total Height

Algorithm · Waymo · Medium

Examples Example Requirements Given the full table width W along with two word lists, one list for each text column, determine where to split the table. The separator may sit at any position $$w \in [w_{\text{min}}, W - w_{\text{min}}]$$; w_min must be large enough to fit the longest individual word in either relevant column. Text in each column must be line-broken greedily within its allotted width, and the resulting line count is that column's height. Return the split…

Checking your access…