You are given a string n representing a large integer and a single integer digit x.
Insert the digit x at any position in n so that the numerical value of the resulting number is maximized. You cannot alter the relative order of the existing digits in n.
Return a string representing the maximum possible value after inserting x.
Constraints:
n.length
x
The digits in n are in the range
n is a valid representation of an integer.
In the case of a negative n, it will begin with '-'.
You are given a string n representing a large integer and a single integer digit x.
Insert the digit x at any position in n so that the numerical value of the resulting number is maximized. You cannot alter the relative order of the existing digits in n.
Return a string representing the maximum possible value after inserting x.
Constraints:
n.length
x
The digits in n are in the range
n is a valid representation of an integer.
In the case of a negative n, it will begin with '-'.