Skip to content

Commit d732a16

Browse files
refactor 418
1 parent 3c2e565 commit d732a16

File tree

1 file changed

+0
-60
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-60
lines changed

src/main/java/com/fishercoder/solutions/_418.java

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 418. Sentence Screen Fitting
5-
*
6-
* Given a rows x cols screen and a sentence represented by a list of non-empty words, find how many times the given sentence can be fitted on the screen.
7-
8-
Note:
9-
10-
A word cannot be split into two lines.
11-
The order of words in the sentence must remain unchanged.
12-
Two consecutive words in a line must be separated by a single space.
13-
Total words in the sentence won't exceed 100.
14-
Length of each word is greater than 0 and won't exceed 10.
15-
1 ≤ rows, cols ≤ 20,000.
16-
17-
Example 1:
18-
19-
Input:
20-
rows = 2, cols = 8, sentence = ["hello", "world"]
21-
22-
Output:
23-
1
24-
25-
Explanation:
26-
hello---
27-
world---
28-
29-
The character '-' signifies an empty space on the screen.
30-
31-
Example 2:
32-
33-
Input:
34-
rows = 3, cols = 6, sentence = ["a", "bcd", "e"]
35-
36-
Output:
37-
2
38-
39-
Explanation:
40-
a-bcd-
41-
e-a---
42-
bcd-e-
43-
44-
The character '-' signifies an empty space on the screen.
45-
46-
Example 3:
47-
48-
Input:
49-
rows = 4, cols = 5, sentence = ["I", "had", "apple", "pie"]
50-
51-
Output:
52-
1
53-
54-
Explanation:
55-
I-had
56-
apple
57-
pie-I
58-
had--
59-
60-
The character '-' signifies an empty space on the screen.
61-
62-
*/
633
public class _418 {
644

655
public static class Solution1 {

0 commit comments

Comments
 (0)