Tap here to switch tabs
Problem
Submissions

Problem: Maximum 69 Number

med
30 min
Try to solve the Maximum 69 Number problem.

Statement

You are given a positive integer num consisting only of digits 66 and 99.

Return the maximum number you can get by changing at most one digit, where a 66 can be changed to a 99 or a 99 can be changed to a 66.

Constraints:

  • 1≤1 \leq num ≤104\leq 10^4

  • num consists of only digits 66 and 99.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum 69 Number

med
30 min
Try to solve the Maximum 69 Number problem.

Statement

You are given a positive integer num consisting only of digits 66 and 99.

Return the maximum number you can get by changing at most one digit, where a 66 can be changed to a 99 or a 99 can be changed to a 66.

Constraints:

  • 1≤1 \leq num ≤104\leq 10^4

  • num consists of only digits 66 and 99.