Question: Write a function solution that given an integer N, returns the maximum possible value obtained by inserting one '5' digit inside the decimal representation of

Write a function solution that given an integer N, returns the maximum possible value obtained by inserting one '5' digit inside the decimal representation of integer N.

Examples: 1. Given N = 268, the function should return 5268.

2. Given N = 670, the function should return 6750.

3. Given N = 0, the function should return 50.

4. Given N = -999, the function should return -5999.

Assume that: N is an integer within the range [-8000..8000].

C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!