Detailed Solution || Comments || Explanation 🔥🔥
Code\n\nclass Solution {\n    public String kthLargestNumber(String[] nums, int k) {\n//Making the priority queue using custom comparator(*Discussed below*)\n  
# Code\n```\nclass Solution {\n    public String kthLargestNumber(String[] nums, int k) {\n//Making the priority queue using custom comparator(*Discussed below*)\n        PriorityQueue<String> pq=new PriorityQueue<>((a,b)->a.length()==b.length()?\n            a.compareTo(b): a.length()-b.length());\n        for(String n: nums){\n            pq.add(n);\n//Deleting the kth largest everytime, so that pq contains only the largest k elements\n            if(pq.size()>k) pq.poll();\n        }\n//Returning the minimum element in pq\n        return pq.poll();\n    }\n}\n```\n\n# Custom Comparator\nThe custom comparator works as follows->\n> if the length of the numbers are equal, then normal string comparison works.\nLet: a=1234, b=3245\nHere, we can see the number a<b by comparing each character in strings.\n\n> if the lengths are not equal, string comparison fails, It is because\nLet: a=1234, b=234\nString comparison will compare \'1\' and \'2\' and say a<b, which is wrong.\nHere, we can simply compare the lengths of the Strings and say a>b.\n\n# Complexities\n> TC: $$O(n*log k)$$\nSC: $$O(k)$$
['Heap (Priority Queue)', 'Java']