1 line Java


  • -1
    W
    public int findKthLargest(int[] nums, int k) {
        return Arrays.stream(nums).sorted().skip(nums.length - k).findFirst().getAsInt();
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.