NeetCode #697LC-418Medium1-D Dynamic Programming
← Back to All Problems

#697 · #418 · Sentence Screen Fitting(屏幕可显示句子的数量)

📌 Problem Statement & Constraints

Given sentence (a list of words) and a screen with rows rows and cols columns, count how many times the sentence can be repeated by filling the screen row by row. Words are separated by a single space and a word may never be split across two rows. Constraints: 1 <= sentence.length <= 100, 1 <= rows, cols <= 2 * 10^4, 1 <= sentence[i].length <= 100.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!