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 601469b

Browse files
Create README - LeetHub
1 parent ac6cc5a commit 601469b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

‎0650-2-keys-keyboard/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<h2><a href="https://leetcode.com/problems/2-keys-keyboard">650. 2 Keys Keyboard</a></h2><h3>Medium</h3><hr><p>There is only one character <code>&#39;A&#39;</code> on the screen of a notepad. You can perform one of two operations on this notepad for each step:</p>
2+
3+
<ul>
4+
<li>Copy All: You can copy all the characters present on the screen (a partial copy is not allowed).</li>
5+
<li>Paste: You can paste the characters which are copied last time.</li>
6+
</ul>
7+
8+
<p>Given an integer <code>n</code>, return <em>the minimum number of operations to get the character</em> <code>&#39;A&#39;</code> <em>exactly</em> <code>n</code> <em>times on the screen</em>.</p>
9+
10+
<p>&nbsp;</p>
11+
<p><strong class="example">Example 1:</strong></p>
12+
13+
<pre>
14+
<strong>Input:</strong> n = 3
15+
<strong>Output:</strong> 3
16+
<strong>Explanation:</strong> Initially, we have one character &#39;A&#39;.
17+
In step 1, we use Copy All operation.
18+
In step 2, we use Paste operation to get &#39;AA&#39;.
19+
In step 3, we use Paste operation to get &#39;AAA&#39;.
20+
</pre>
21+
22+
<p><strong class="example">Example 2:</strong></p>
23+
24+
<pre>
25+
<strong>Input:</strong> n = 1
26+
<strong>Output:</strong> 0
27+
</pre>
28+
29+
<p>&nbsp;</p>
30+
<p><strong>Constraints:</strong></p>
31+
32+
<ul>
33+
<li><code>1 &lt;= n &lt;= 1000</code></li>
34+
</ul>

0 commit comments

Comments
(0)

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