File tree 1 file changed +0
-20
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 664. Strange Printer
5
- *
6
- * There is a strange printer with the following two special requirements:
7
- * The printer can only print a sequence of the same character each time.
8
- * At each turn, the printer can print new characters starting from and ending at any places, and will cover the original existing characters.
9
- * Given a string consists of lower English letters only, your job is to count the minimum number of turns the printer needed in order to print it.
10
-
11
- Example 1:
12
- Input: "aaabbb"
13
- Output: 2
14
- Explanation: Print "aaa" first and then print "bbb".
15
-
16
- Example 2:
17
- Input: "aba"
18
- Output: 2
19
- Explanation: Print "aaa" first and then print "b" from the second place of the string, which will cover the existing character 'a'.
20
-
21
- Hint: Length of the given string will not exceed 100.
22
- */
23
3
public class _664 {
24
4
public static class Solution1 {
25
5
/**
You can’t perform that action at this time.
0 commit comments