Maximum 69 Number
You are given a positive integer num consisting only of digits 6 and 9.
Return the maximum number you can get by changing at most one digit, where 6 becomes 9, and 9 becomes 6.
Example 1
Input
num = 9669Output
9969Changing the second digit results in 9969, which is the maximum possible number after at most one change.
Example 2
Input
num = 9996Output
9999Changing the last digit 6 to 9 results in the maximum number.
Constraints
- 1 <= num <= 10^4
- num consists of only 6 and 9 digits.