Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 285bd3d

Browse files
Create README - LeetHub
1 parent eea7940 commit 285bd3d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

‎0664-strange-printer/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<h2><a href="https://leetcode.com/problems/strange-printer/">664. Strange Printer</a></h2><h3>Hard</h3><hr><p>There is a strange printer with the following two special properties:</p>
2+
3+
<ul>
4+
<li>The printer can only print a sequence of <strong>the same character</strong> each time.</li>
5+
<li>At each turn, the printer can print new characters starting from and ending at any place and will cover the original existing characters.</li>
6+
</ul>
7+
8+
<p>Given a string <code>s</code>, return <em>the minimum number of turns the printer needed to print it</em>.</p>
9+
10+
<p>&nbsp;</p>
11+
<p><strong class="example">Example 1:</strong></p>
12+
13+
<pre>
14+
<strong>Input:</strong> s = &quot;aaabbb&quot;
15+
<strong>Output:</strong> 2
16+
<strong>Explanation:</strong> Print &quot;aaa&quot; first and then print &quot;bbb&quot;.
17+
</pre>
18+
19+
<p><strong class="example">Example 2:</strong></p>
20+
21+
<pre>
22+
<strong>Input:</strong> s = &quot;aba&quot;
23+
<strong>Output:</strong> 2
24+
<strong>Explanation:</strong> Print &quot;aaa&quot; first and then print &quot;b&quot; from the second place of the string, which will cover the existing character &#39;a&#39;.
25+
</pre>
26+
27+
<p>&nbsp;</p>
28+
<p><strong>Constraints:</strong></p>
29+
30+
<ul>
31+
<li><code>1 &lt;= s.length &lt;= 100</code></li>
32+
<li><code>s</code> consists of lowercase English letters.</li>
33+
</ul>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /