public int findKthLargest(int[] nums, int k) {
if (nums == null  nums.length == 0  k <= 0  k > nums.length) {
return 1;
}
Arrays.sort(nums);
int N = nums.length;
return nums[N  k];
}
Very simple java solution beats 80%

Much better I used Collections.sort with a boxed integer array  that beats 50%  your solution is surely better and simple. in fact this one is fine too. Value of k is always guaranteed to be in range so you can ignore those checks.
public class Solution { public int findKthLargest(int[] nums, int k) { if (nums == null  nums.length == 0) return 1; Arrays.sort(nums); return nums[nums.lengthk]; }}