2343. Query Kth Smallest Trimmed Number
On This Page
class Solution:
def smallestTrimmedNumbers(
self, nums: List[str], queries: List[List[int]]
) -> List[int]:
res = []
for k, trim in queries:
t = sorted((v[-trim:], i) for i, v in enumerate(nums))
res.append(t[k - 1][1])
return res