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're given a positive integer made up entirely of the digits 6 and 9. Work out the biggest value obtainable by flipping at most one of its digits upside down (a 6 becomes a 9, and a 9 becomes a 6). For example, take the integer 696: Flipping the first digit (6 → 9) gives 996. Flipping the second digit (9 → 6) gives 666. Flipping the third digit (6 → 9) gives 699. Comparing 696, 996, 666, and 699, the largest is 996. Write a