Company: Quince_sde
Difficulty: medium
Maximize Number by Flipping a Single Digit body { font-family: sans-serif; line-height: 1.6; } h1 { color: #333; } h2 { color: #555; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-top: 20px; } h3 { color: #777; margin-top: 15px; } pre { background-color: #f4f4f4; padding: 10px; border-radius: 5px; overflow-x: auto; } code { font-family: monospace; } ul { list-style-type: disc; margin-left: 20px; } ol { list-style-type: decimal; margin-left: 20px; } p { margin-bottom: 10px; } Maximize Number by Flipping a Single Digit Problem Description You are given a positive integer consisting only of digits 6 and 9. Find the maximum value that can be achieved by turning at most one digit upside down (6 becomes 9 and 9 becomes 6). For example, given integer 696: Turning the first digit upside down (6 → 9) would result in the number 996. Turning the second digit upside down (9 → 6) would result in the number 666. Turning the third digit upside down (6 → 9) would result in t