[Java] Custom Sorting, O(NlogN)
The kth largest element is equivalent to the n-kth smallest element. Thus, lets sort the strings, first by their length, and break ties by the string comparator
The `kth` largest element is equivalent to the `n-kth` smallest element. Thus, lets sort the strings, first by their length, and break ties by the string comparator. Then, return the `n-kth` element.\n\nTime Complexity - O(NlogN)\nSpace Complexity - O(1) \n```\nclass Solution {\n    public String kthLargestNumber(String[] nums, int k) {\n        Arrays.sort(nums, new Comparator<String>(){\n            @Override\n            public int compare(String a, String b){\n                if(a.length() != b.length()) return a.length() - b.length();\n                return a.compareTo(b);\n            }\n        });\n        return nums[nums.length-k];\n    }\n}\n```
[]