#JavaScript (ES6), 3167 bytes
a=>+[a=>[...a]z=[...Array(a)].map((b,c)=>c+1)].reverse().join``+a*1join``- -z.join``
Takes input as a numeric string.
The function takes in a string and splits it into an array (using [...a]
) in order to take advantage of the reverse
function, then join
to put it back together. The first +
is to coerce the reversed string into a number again. Now we add itFixed to the original number with +a*1
meet requirement, whereas old code was made under misunderstanding of the *1
is likewise used to coerce it into a numberinput.