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 61fe55a

Browse files
committed
Added README.md file for Maximum 69 Number
1 parent 39cc33d commit 61fe55a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

‎1448-maximum-69-number/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<h2><a href="https://leetcode.com/problems/maximum-69-number">Maximum 69 Number</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>You are given a positive integer <code>num</code> consisting only of digits <code>6</code> and <code>9</code>.</p>
2+
3+
<p>Return <em>the maximum number you can get by changing <strong>at most</strong> one digit (</em><code>6</code><em> becomes </em><code>9</code><em>, and </em><code>9</code><em> becomes </em><code>6</code><em>)</em>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> num = 9669
10+
<strong>Output:</strong> 9969
11+
<strong>Explanation:</strong>
12+
Changing the first digit results in 6669.
13+
Changing the second digit results in 9969.
14+
Changing the third digit results in 9699.
15+
Changing the fourth digit results in 9666.
16+
The maximum number is 9969.
17+
</pre>
18+
19+
<p><strong class="example">Example 2:</strong></p>
20+
21+
<pre>
22+
<strong>Input:</strong> num = 9996
23+
<strong>Output:</strong> 9999
24+
<strong>Explanation:</strong> Changing the last digit 6 to 9 results in the maximum number.
25+
</pre>
26+
27+
<p><strong class="example">Example 3:</strong></p>
28+
29+
<pre>
30+
<strong>Input:</strong> num = 9999
31+
<strong>Output:</strong> 9999
32+
<strong>Explanation:</strong> It is better not to apply any change.
33+
</pre>
34+
35+
<p>&nbsp;</p>
36+
<p><strong>Constraints:</strong></p>
37+
38+
<ul>
39+
<li><code>1 &lt;= num &lt;= 10<sup>4</sup></code></li>
40+
<li><code>num</code>&nbsp;consists of only <code>6</code> and <code>9</code> digits.</li>
41+
</ul>

0 commit comments

Comments
(0)

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