You are given a positive integer num made only of the digits 6 and 9. You may change at most one digit (a 6 becomes a 9, or a 9 becomes a 6). Return the largest number you can get.
You are given a positive integer num made only of the digits 6 and 9. You may change at most one digit (a 6 becomes a 9, or a 9 becomes a 6). Return the largest number you can get.
Example 1:
Input: {"num":9669}
Output: 9969
Constraints:
1≤num≤104
num consists only of the digits 6 and 9.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"num":9669}
num = 9669. We may change at most one digit, and we want the result as large as possible.