Search
⌘K

Leetcode 68. Text Justification

Pack words greedily into lines of exactly maxWidth characters and insert spaces so each line is fully justified. Extra spaces between words must be distributed as evenly as possible with any leftover spaces placed on the leftmost gaps, while the last line (or a line with a single word) is left-justified.

Asked at:

Capital One

Capital One

Amazon

Amazon

Coursera

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early April, 2026

Capital One

Capital One

Senior

Late March, 2026

Capital One

Capital One

Senior

Late November, 2025

Coursera

Senior

Your account is free and you can post anonymously if you choose.