0418. Sentence Screen Fitting
Description
**Input:** sentence = ["hello","world"], rows = 2, cols = 8
**Output:** 1
**Explanation:**
hello---
world---
The character '-' signifies an empty space on the screen.**Input:** sentence = ["a", "bcd", "e"], rows = 3, cols = 6
**Output:** 2
**Explanation:**
a-bcd-
e-a---
bcd-e-
The character '-' signifies an empty space on the screen.ac1: brute force
ac2: memorization
Last updated