You are given an array of strings nums, where each string consists of digits and all strings have the same length. You are also given a queries, where queries[i] = [ k_i , trim_i ].
For each query:
Trim each number in nums to its rightmost trim_i digits.
Find the original index of the nums is considered smaller.
Reset each number in nums to its initial length before processing the next query.
Return an array of integers representing the answers to each query in order.
Note: Trimmed numbers with leading zeros are still evaluated based on their numerical value. Since all trimmed strings for a query have the exact same length of
trim_idigits, their numerical comparison is identical to their lexicographical comparison.
Constraints:
nums.length
nums[i].length
nums[i] consists of only digits.
All nums[i].length are equal.
queries.length
queries[i].length
k_i nums.length
trim_i nums[i].length
You are given an array of strings nums, where each string consists of digits and all strings have the same length. You are also given a queries, where queries[i] = [ k_i , trim_i ].
For each query:
Trim each number in nums to its rightmost trim_i digits.
Find the original index of the nums is considered smaller.
Reset each number in nums to its initial length before processing the next query.
Return an array of integers representing the answers to each query in order.
Note: Trimmed numbers with leading zeros are still evaluated based on their numerical value. Since all trimmed strings for a query have the exact same length of
trim_idigits, their numerical comparison is identical to their lexicographical comparison.
Constraints:
nums.length
nums[i].length
nums[i] consists of only digits.
All nums[i].length are equal.
queries.length
queries[i].length
k_i nums.length
trim_i nums[i].length