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 the kth 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.

&nbsp;
Example 1:

Input: nums = ["3","6","7","10"], k = 4
Output: "3"
Explanation:
The numbers in nums sorted in non-decreasing order are ["3","6","7","10"].
The 4th largest integer in nums is "3".


Example 2:

Input: nums = ["2","21","12","1"], k = 3
Output: "2"
Explanation:
The numbers in nums sorted in non-decreasing order are ["1","2","12","21"].
The 3rd largest integer in nums is "2".


Example 3:

Input: nums = ["0","0"], k = 2
Output: "0"
Explanation:
The numbers in nums sorted in non-decreasing order are ["0","0"].
The 2nd largest integer in nums is "0".


&nbsp;
Constraints:


	1 &lt;= k &lt;= nums.length &lt;= 104
	1 &lt;= nums[i].length &lt;= 100
	nums[i] consists of only digits.
	nums[i] will not have any leading zeros.


class Solution:
    def kthLargestNumber(self, nums: List[str], k: int) -> str:
        nums = sorted(map(int, nums), reverse=True)
        return str(nums[k-1])
class Solution {
    public String kthLargestNumber(String[] nums, int k) {
        
        int n=nums.length;
        
        Arrays.sort(nums,(a,b)->{
            if(a.length()>b.length()) return 1;
            else if(b.length()>a.length()) return -1;
            else{
              return isgreater(a,b);   
            }
        });
        return nums[n-k];        
    }
    
    public static int isgreater(String a,String b){
        
        int n=a.length();
        
        for(int i=0;i<n;i++){
            int a1=Integer.parseInt(""+a.charAt(i));
            int b1=Integer.parseInt(""+b.charAt(i));
            if(a1>b1) return 1;
            if(b1>a1) return -1;
        }
        return 0;
    }
}
class Solution {
public:
    static bool cmp(string &a,string &b)
    {
        if(a.size()==b.size())
        {
            return a<b;
        }
        return a.size()<b.size();
    }
    string kthLargestNumber(vector<string>& nums, int k)
    {
        sort(nums.begin(),nums.end(),cmp);
        int n=nums.size();
        return nums[n-k];
    }
};
var kthLargestNumber = function(nums, k) {
    const n = nums.length;
    k = n - k; 
    
    return quickSelect(nums, k, 0, n - 1);
    
    
    function quickSelect(arr, selectIdx, left, right) {
        const pivotIdx = Math.floor(Math.random() * (right - left + 1) + left);
        const pivotNum = arr[pivotIdx];
        
        swap(arr, pivotIdx, right);
        
        let swapIdx = left;
        
        for (let i = left; i < right; i++) {
            if (compare(arr[i], pivotNum) < 0) {
                swap(arr, swapIdx, i);
                swapIdx++;
            }
        }
        
        swap(arr, swapIdx, right);
        
        if (swapIdx === selectIdx) return arr[selectIdx];
        
        if (swapIdx > selectIdx) return quickSelect(arr, selectIdx, left, swapIdx - 1);
        if (swapIdx < selectIdx) return quickSelect(arr, selectIdx, swapIdx + 1, right);
    }
    
    
    function compare(numStr1, numStr2) {
        if (numStr1.length > numStr2.length) return 1;
        if (numStr2.length > numStr1.length) return -1;
        
        return numStr1.localeCompare(numStr2);
    }
    
    function swap(arr, i, j) {
        [arr[i], arr[j]] = [arr[j], arr[i]];
    }
};
Find the Kth Largest Integer in the Array