Skip to content

Commit aebee3a

Browse files
committed
Add solution #1323
1 parent ebda708 commit aebee3a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
1313|[Decompress Run-Length Encoded List](./1313-decompress-run-length-encoded-list.js)|Easy|
5353
1317|[Convert Integer to the Sum of Two No-Zero Integers](./1317-convert-integer-to-the-sum-of-two-no-zero-integers.js)|Easy|
5454
1318|[Minimum Flips to Make a OR b Equal to c](./1318-minimum-flips-to-make-a-or-b-equal-to-c.js)|Medium|
55+
1323|[Maximum 69 Number](./1323-maximum-69-number.js)|Easy|
5556
1324|[Print Words Vertically](./1324-print-words-vertically.js)|Medium|
5657

5758
## License

solutions/1323-maximum-69-number.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* 1323. Maximum 69 Number
3+
* https://leetcode.com/problems/maximum-69-number/submissions/
4+
* Difficulty: Easy
5+
*
6+
* Given a positive integer num consisting only of digits 6 and 9.
7+
*
8+
* Return the maximum number you can get by changing at most
9+
* one digit (6 becomes 9, and 9 becomes 6).
10+
*/
11+
12+
/**
13+
* @param {number} num
14+
* @return {number}
15+
*/
16+
var maximum69Number = function(num) {
17+
return +String(num).replace(6, 9);
18+
};

0 commit comments

Comments
 (0)