Skip to content

Commit 76f7cc0

Browse files
committed
Create README - LeetHub
1 parent f23e067 commit 76f7cc0

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

maximum-69-number/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<h2>1323. Maximum 69 Number</h2><h3>Easy</h3><hr><div><p>Given a positive integer <code>num</code> consisting only of digits 6 and 9.</p>
2+
3+
<p>Return the maximum number you can get by changing <strong>at most</strong> one digit (6 becomes 9, and 9 becomes 6).</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong>Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> num = 9669
9+
<strong>Output:</strong> 9969
10+
<strong>Explanation:</strong>
11+
Changing the first digit results in 6669.
12+
Changing the second digit results in 9969.
13+
Changing the third digit results in 9699.
14+
Changing the fourth digit results in 9666.&nbsp;
15+
The maximum number is 9969.
16+
</pre>
17+
18+
<p><strong>Example 2:</strong></p>
19+
20+
<pre><strong>Input:</strong> num = 9996
21+
<strong>Output:</strong> 9999
22+
<strong>Explanation:</strong> Changing the last digit 6 to 9 results in the maximum number.</pre>
23+
24+
<p><strong>Example 3:</strong></p>
25+
26+
<pre><strong>Input:</strong> num = 9999
27+
<strong>Output:</strong> 9999
28+
<strong>Explanation:</strong> It is better not to apply any change.</pre>
29+
30+
<p>&nbsp;</p>
31+
<p><strong>Constraints:</strong></p>
32+
33+
<ul>
34+
<li><code>1 &lt;= num &lt;= 10^4</code></li>
35+
<li><code>num</code>'s digits are 6 or 9.</li>
36+
</ul></div>

0 commit comments

Comments
 (0)