Practice Query Kth Smallest Trimmed Number
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Query Kth Smallest Trimmed Number
Problem Statement
For each query [k, trim], keep only the rightmost trim digits of each equal-length string in nums. Order these trimmed values numerically, breaking ties by smaller original index, and return the original index of the kth value, counting from 1. Leading zeros are allowed. Each query uses the original full strings independently. Return the indices in query order. Follow-up: consider radix sort and its complexity.
Source: Query Kth Smallest Trimmed Number on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = ["102","473","251","814"], queries = [[1,1],[2,3],[4,2],[1,2]]
[2,2,1,0]
# Example 2
nums = ["24","37","96","04"], queries = [[2,1],[2,2]]
[3,0]
Constraints
Related LeetCode Problems
Practice more problems similar to Query Kth Smallest Trimmed Number.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.