← All problemsSign in

Nicest number

Given a positive integer $n$ consisting only of digits 6 and 9. Print the maximum number you can get by changing at most one digit (6 becomes 9, and 9 becomes 6). ###Input: - First line will contain the positive integer $n$ ###Output: output in a single line answer. ###Constraints - $1 \leq n \leq 1000$ - $n$ contains only 6's and 9's ###Sample Input: 9669 ###Sample Outp

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start