# https://leetcode.com/problems/first-missing-positive/

from heapq import heapify, heappop

class Solution:
    def firstMissingPositive(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        expected = 1
        heapify(nums)
        while nums:
            x = heappop(nums)
            if x == expected:
                expected += 1
        return expected

4a6d4a322f332faab8e7ca71cf0996fc9639e580
<mask token>

<mask token>


class Solution:
    <mask token>

<mask token>


class Solution:

    def firstMissingPositive(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        expected = 1
        heapify(nums)
        while nums:
            x = heappop(nums)
            if x == expected:
                expected += 1
        return expected

from heapq import heapify, heappop


class Solution:

    def firstMissingPositive(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        expected = 1
        heapify(nums)
        while nums:
            x = heappop(nums)
            if x == expected:
                expected += 1
        return expected

# https://leetcode.com/problems/first-missing-positive/

from heapq import heapify, heappop

class Solution:
    def firstMissingPositive(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        expected = 1
        heapify(nums)
        while nums:
            x = heappop(nums)
            if x == expected:
                expected += 1
        return expected
