[>Ð{Q#
Try it online or verify almost all test cases (except for the last one, which is shortened a bit).
Explanation:
[ # Loop indefinitely:
> # Increase the current value by 1
# (which will be the implicit input in the first iteration)
Ð # Triplicate it
{ # Sort the digits in the top copy
Q # Pop it and another copy and check if they're still the same
# # If it is: stop the infinite loop
# (after which the remaining third value is output implicitly as result)
Here a different approach which also handles the largest test case (14 bytes):
>Dü›Å¡ćJs˜¬s∍«
Try it online or verify all test cases.
Explanation:
# E.g. input = 11123159995399999
> # Increase the (implicit) input-integer by 1
# STACK: 11123159995400000
D # Duplicate it
# STACK: 11123159995400000,11123159995400000
ü # For each overlapping pair of digits:
› # Check if the first is larger than the second
# STACK: 11123159995400000,[0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0]
Å¡ # Split the (implicit) input-integer at the truthy positions
# STACK: [[1,1,1,2],[3,1,5,9,9],[9],[5],[4,0,0,0,0,0]]
ć # Extract head; pop and push first list and remainder-lists
# separated to the stack
# STACK: [[3,1,5,9,9],[9],[5],[4,0,0,0,0,0]],[1,1,1,2]
J # Join this first list together to a single integer
# STACK: [[3,1,5,9,9],[9],[5],[4,0,0,0,0,0]],1112
s # Swap to get the remainder-list
# STACK: 1112,[[3,1,5,9,9],[9],[5],[4,0,0,0,0,0]]
˜ # Flatten it
# STACK: 1112,[3,1,5,9,9,9,5,4,0,0,0,0,0]
¬ # Push its first digit (without popping the list)
# STACK: 1112,[3,1,5,9,9,9,5,4,0,0,0,0,0],3
s # Swap so the list is at the top
# STACK: 1112,3,[3,1,5,9,9,9,5,4,0,0,0,0,0]
∍ # Extend this digit to the length of this list
# STACK: 1112,3333333333333
« # Append the two strings together
# STACK: 11123333333333333
# (after which the result is output implicitly)
-113
? (Note that, strictly speaking, the digits of-113
are[-1, -1, -3]
even though these might not be considered "digits"!), i.e. \$-113=-1*100+-1*10+-1*1\$, and as such the the answer would be-111
but most solutions would probably output-112
) hence easiest to limit to at least "non-negative integers" \$\endgroup\$