100-days-of-rust/Week-05/Day-30_The-Maximum-Value
2023-03-23 21:14:34 -04:00
..
README.md Add files via upload 2023-03-23 21:14:34 -04:00

The Maximum Value

Write a function that returns the maximum possible value obtained by inserting any single digit inside the decimal representation of integer N.

Details

Write a function that returns the maximum possible value obtained by inserting one single digit inside the decimal representation of integer N.

Example

Given N = 276, Digit = 3, function should return 3276
Given N = -999, Digit = 4, function should return -4999
Given N = 0, Digit = 3, function should return 30
Given N = 860, Digit = 7, function should return 8760