Question: Write a function solution that, given an integer X, returns the maximum possible value obtained by adding 5 to one digit inside the decimal

Write a function "solution" that, given an integer X, returns the maximum possible value obtained by adding 5 to one digit inside the decimal representation of integer X. Examples: 1. Given X = 268, the function should return 2613. 2. Given X = 670, the function should return 6120. 4. Given X = 5, the function should return 10. Assume that: X is an integer within the range [0...100000]. In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
