Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Text Justification

XPChallenge Points: 30
levelLevel: Hard

You are given a list of words and a maximum line width maxWidth. Arrange the words in lines so that:


1. Each line has exactly maxWidth characters.
2. Spaces between words are distributed evenly. Extra spaces go to the left if needed.
3. The last line is left-justified (no extra spaces between words).

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result