Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2052. Minimum Cost to Separate Sentence Into Rows
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.