>_
Compiler Shell v1.0.4
Connection to data node secure.
Parsed 600 algorithm challenges.
Mounted telemetry indexes.
> Launching prep command center...
Compiling 0%
Medium 💻 Coding

[Go Programming] Kth Largest Element in an Array

Problem Statement

Problem Statement for Kth Largest Element in an Array under Go Programming:

Given an integer array nums and an integer k, return the kth largest element in the array.

Input Constraints:
- 1 <= len(nums) <= 10^5
- Elements fit in memory standard spaces.

Proposed Solution

import heapq
def findKthLargest(nums, k):
    return heapq.nlargest(k, nums)[-1]

Your Progress

Pending Completion

Save Progress?

Login to sync your solutions across all dynamic local and remote sessions.

Join Techlance
Back to Curriculum