Microsoft Online Assessment Question
Anonymous User
10008

Write a function, solution, that given an integer N, returns the maximum possible value obtained by inserting '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 of [-8000 - 8000]

Please help me understand this, in javascript preferably

Comments (5)