
You are given a 0-indexed array of strings nums , where each string is of equal length and consists of only digits.
You are also given a 0-indexed 2D integer array queries where queries[i] = [k _i , trim _i ] . For each queries[i] , you need to:
Trim each number in nums to its rightmost trim _i digits.
Determine the index of the k _i ^th smallest trimmed number in nums . If two trimmed numbers are equal, the number with the lower index is considered to be smaller.
Reset each number in nums to its original length.
Return an array answer of the same length as queries , where answer[i] is the answer to the i ^th query.
Note :
To trim to the rightmost x digits means to keep removing the leftmost digit, until only x digits remain.
Strings in nums may contain leading zeros.
1 <= nums.length <= 1001 <= nums[i].length <= 100nums[i] consists of only digits.All nums[i].length are equal .1 <= queries.length <= 100queries[i].length == 21 <= k _i <= nums.length1 <= trim _i <= nums[i].lengthFollow up: Could you use the Radix Sort Algorithm to solve this problem? What will be the complexity of that solution?