from heapq import heappop, heappush


class Solution:

    def findKthLargest(self, A, k):
        """
        :type A: List[int]
        :type k: int
        :rtype: int
        """
        heap = []
        for a in A:
            heappush(heap, a)
            if len(heap) > k:
                heappop(heap)
        return heappop(heap)

4a36d92befb52bd11a4e2844e6e3f369c1bd55f6
<mask token>

<mask token>


class Solution:
    <mask token>

<mask token>


class Solution:

    def findKthLargest(self, A, k):
        """
        :type A: List[int]
        :type k: int
        :rtype: int
        """
        heap = []
        for a in A:
            heappush(heap, a)
            if len(heap) > k:
                heappop(heap)
        return heappop(heap)

from heapq import heappop, heappush


class Solution:

    def findKthLargest(self, A, k):
        """
        :type A: List[int]
        :type k: int
        :rtype: int
        """
        heap = []
        for a in A:
            heappush(heap, a)
            if len(heap) > k:
                heappop(heap)
        return heappop(heap)
