Java | 2 Solutions | Easy Implementations | Big Integer & Comparator Solutions
Solution 1:\n\nimport java.math.BigInteger;\n\nclass Solution {\n    public String kthLargestNumber(String[] nums, int k) {\n        if(nums==null || nums.lengt
**Solution 1:**\n```\nimport java.math.BigInteger;\n\nclass Solution {\n    public String kthLargestNumber(String[] nums, int k) {\n        if(nums==null || nums.length==0) return "";\n        \n        PriorityQueue<BigInteger> pq=new PriorityQueue<>();\n        \n        for(int i=0;i<nums.length;i++){\n            if(i<k) pq.add(new BigInteger(nums[i]));\n            else{\n                pq.add(new BigInteger(nums[i]));\n                pq.poll();\n            }\n        }\n        return pq.peek().toString();\n    }\n}\n```\n\n**Solution 2:**\n```\nclass Solution {\n    public String kthLargestNumber(String[] nums, int k) {\n        if(nums==null || nums.length==0) return "";\n        \n        PriorityQueue<String> pq=new PriorityQueue<>((s1,s2)->{\n            if(s1.length()==s2.length()) return s1.compareTo(s2);\n            else return s1.length()-s2.length();\n        });\n        \n        for(int i=0;i<nums.length;i++){\n            if(i<k) pq.add(nums[i]);\n            else{\n                pq.add(nums[i]);\n                pq.poll();\n            }\n        }\n        return pq.peek();\n    }\n}\n```
['Heap (Priority Queue)', 'Java']