Imagine you're a financial analyst dealing with very large numbers that exceed typical integer limits. You have an array of strings, where each string represents a massive integer without leading zeros, and you need to find the k-th largest value.
๐ฏ Your Mission: Given an array of numeric strings nums and an integer k, return the string representing the k-th largest integer.
Important: Duplicate numbers count as separate entries. For example, if nums = ["1", "2", "2"], then:
- 1st largest = "2" (first occurrence)
- 2nd largest = "2" (second occurrence)
- 3rd largest = "1"
Why strings? These numbers can be arbitrarily large - think cryptocurrency wallet balances or scientific calculations that would overflow regular integers!
Input & Output
Visualization
Time & Space Complexity
Sorting takes O(n log n) comparisons, each comparison takes O(m) time where m is average string length
Space used by the sorting algorithm's recursion stack
Constraints
- 1 โค nums.length โค 104
- 1 โค nums[i].length โค 100
- 1 โค k โค nums.length
- nums[i] consists of only digits
- nums[i] will not have any leading zeros