You are given an array of strings nums and an integer k. Each string in
nums represents an integer without leading zeros.
Return the string that represents thekth _largest integer in _nums.
Note : Duplicate numbers should be counted distinctly. For example, if
nums is ["1","2","2"], "2" is the first largest integer, "2" is the second-largest integer, and "1" is the third-largest integer.
Input: nums =["3","6","7","10"], k =4Output: "3"Explanation:
The numbers in nums sorted in non-decreasing order are ["3","6","7","10"].The 4th largest integer in nums is"3".
Input: nums =["2","21","12","1"], k =3Output: "2"Explanation:
The numbers in nums sorted in non-decreasing order are ["1","2","12","21"].The 3rd largest integer in nums is"2".
Input: nums =["0","0"], k =2Output: "0"Explanation:
The numbers in nums sorted in non-decreasing order are ["0","0"].The 2nd largest integer in nums is"0".
Since the numbers are represented as strings and can be very large, we cannot convert them to integers directly. To compare two numbers as strings, compare their lengths first; if equal, compare lexicographically. Sorting the array with this custom comparator allows us to find the k-th largest easily.