Search⌘ K
AI Features

Text Justification

Text Justification reformats an array of words into lines of exactly maxWidth characters, packing words greedily and distributing spaces evenly. The last line and single-word lines are left-justified.

Statement

You are given an array of strings, words, and an integer, maxWidth. Your task is to reformat the ...