Algorithm · Robinhood · Medium
Problem Overview You receive an array of strings and must arrange them into lines that can be shown on a screen. Different versions of the prompt provide: A string[]. A settings object like { numberOfRow, maxWidth }. A delimiter string. This interview task is commonly split into two stages: First, lay out strings in rows while observing the row limit, the maximum width per row, and the delimiter. Next, apply a greedy rule that puts each string into the row that currently has…
Checking your access…