Article Layout
Asked at Airbnb
Reported by the problem's creator, not verified
You are laying out the text of an article as the class ArticleLayout, created with the article's text. The text is words separated by single spaces, and a word is never split across lines.
Examples
Example 1
Input: init =
["the quick brown fox jumps over the lazy dog"], operations =[["by_line_count",[3]]]Output:
[["the quick brown","fox jumps over","the lazy dog"]]Explanation: At width 14 the greedy lines are
the quick,brown fox,jumps over the,lazy dog, which is four lines. At width 15 they arethe quick brown,fox jumps overandthe lazy dog, which is three, so 15 is the narrowest width and those are the lines.
Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.