Dynamic Programming with Word Start Index and Sentence Count
Initialize two arrays, nextIndex and times, of length equal to the number of words in the sentence.
For each word in the sentence, calculate the starting index of the next row and the number of sentences that can be completed if the row starts with this word.
Iterate over the rows, using the precomputed nextIndex to find the starting word of the next row and times to add the number of sentences completed on the current row to the total count.
Return the total count of sentences that fit on the screen.