[Python3] Heap - Simple Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def unmarkedSumArray(self, nums: List[int], queries: List[List[int]]) -> List[int]:\n        n, s = len(nums), sum(nums)\n        marked = [0 for _ in range(n)]\n        pq = [(num, i) for i, num in enumerate(nums)]\n        heapq.heapify(pq)\n        res = []\n        for idx, k in queries:\n            if not marked[idx]: s -= nums[idx]\n            marked[idx] = 1\n            while k and pq:\n                _, i = heapq.heappop(pq)\n                k -= marked[i] == 0\n                if not marked[i]: s -= nums[i]\n                marked[i] = 1\n            res.append(s)\n        return res\n```
['Heap (Priority Queue)', 'Python3']