Back to problems

Text Justification

Algorithm · Google · Hard

The main phone-screen prompt was described as being extremely close to a classic full-text-justification exercise. A separate prompt asked: given a collection of text that must fit into a two-column table on a page with a fixed width, find the column width that produces the smallest possible total table height. That prompt was presented as a follow-up, and it was addressed with a binary-search approach. Given a string array words and an integer maxWidth, arrange the text so…

Checking your access…