Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1618. Maximum Font to Fit a Sentence in a Screen
Given a screen width and height, a sentence (words separated by spaces), and a font-size-dependent character width/line height model, find the largest integer font size that lets you fit the whole sentence on the screen without breaking words. This requires a feasibility check by greedily simulating word wrapping for a candidate size and using binary search (or monotonic search) over font sizes to maximize it.
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.