Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 957411d

Browse files
authored
Create Find the Kth Largest Integer in the Array.java
1 parent 3cd74fd commit 957411d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Solution {
2+
public String kthLargestNumber(String[] nums, int k) {
3+
Arrays.sort(nums, (o1, o2) ->
4+
o1.length() == o2.length() ? o1.compareTo(o2) : o1.length() - o2.length());
5+
return nums[nums.length - k];
6+
}
7+
}

0 commit comments

Comments
 (0)