Available question text
Given a sequence of words and a maximum line width, partition the words (in order) into rows to minimize the total penalty where each row incurs a cost based on unused spaces (e.g., squared slack or other badness); the last row may be exempt or handled differently. This is a sequence-partitioning / dynamic programming problem of choosing breakpoints to minimize summed row costs.
Related questions
Continue with questions that share topics or the same question type.
- Divide an Array Into Subarrays With Minimum Cost I
Coding
- Divide an Array Into Subarrays With Minimum Cost II
Coding
- Minimum Cost to Divide Array Into Subarrays
Coding
- Minimum Cost to Split into Ones
Coding · Dynamic Programming · Math
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2052. Minimum Cost to Separate Sentence Into Rows
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source