import java.util.Arrays;
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
public int findKthLargest(int[] nums, int k) {
Arrays.sort(nums);
int length = nums.length;
return nums[length - k];
}
}
215. 数组中的第K个最大元素
最新推荐文章于 2024-08-26 09:22:10 发布