import heapq class KthLargest: # Constructor to initialize heap and add values in it def __init__(self, k, nums): print("\tInitializing the heap") self.top_k_heap = [] self.k = k print("\tk =", self.k) print("\tHeap:", self.top_k_heap) for element in nums: print("Adding element", element, "to the heap.") self.add(element) # Adds element in the heap and return the Kth largest def add(self, val): pass # Driver code def main(): nums = [3, 6, 9, 10] print("Initial stream: ", nums, sep = "") k_largest = KthLargest(3, nums) if __name__ == "__main__": main()