You are given a string num representing a large integer, and an integer k.
A wonderful integer is defined as a permutation of the digits in num that is strictly greater in value than num.
Return the minimum number of adjacent digit swaps needed to transform num into the
Note: The test cases are generated such that the
smallest wonderful integer always exists.
Constraints:
num.length
k
num consists only of digits.
You are given a string num representing a large integer, and an integer k.
A wonderful integer is defined as a permutation of the digits in num that is strictly greater in value than num.
Return the minimum number of adjacent digit swaps needed to transform num into the
Note: The test cases are generated such that the
smallest wonderful integer always exists.
Constraints:
num.length
k
num consists only of digits.