"""
Exercise 1: Kth Largest Element in a Stream (LeetCode 703)

KthLargest(k, nums); add(val) adds val and returns the k-th largest element
seen so far. Keep a min-heap (heapq) of size k.
"""

class KthLargest:
    def __init__(self, k, nums):
        # TODO
        pass

    def add(self, val):
        # TODO
        return 0


# --- self-check: do not modify below this line ---
kl = KthLargest(3, [4, 5, 8, 2])
got = [kl.add(v) for v in [3, 5, 10, 9, 4]]
print(got)
print("PASS" if got == [4, 5, 5, 8, 8] else "FAIL")
