Text Justification

Given a list of words and a maximum line width, format the text so that each line has exactly maxWidth characters. Lines should be fully justified except for the last line, which should be left-justified, and except for a line holding a single word, which is also left-justified. Extra spaces on a fully justified line are spread as evenly as possible, with the leftmost gaps receiving any remainder.

Examples
Input: [["This","is","an","example","of","text","justification."],16]
Output: ["This is an","example of text","justification. "]
Hints

Text Justification

Given a list of words and a maximum line width, format the text so that each line has exactly `maxWidth` characters. Lines should be fully justified except for the last line, which should be left-justified, and except for a line holding a single word, which is also left-justified. Extra spaces on a fully justified line are spread as evenly as possible, with the leftmost gaps receiving any remainder.