楼主: 
dont   2024-12-13 09:09:342593. Find Score of an Array After Marking All Elements
## 思路
建(num, idx) 的min heap
每次pop检查idx有没有mark过, 没有就+score并mark
## Code
```python
class Solution:
    def findScore(self, nums: List[int]) -> int:
        n = len(nums)
        heap = []
        for idx, num in enumerate(nums):
            heapq.heappush(heap, (num, idx))
        res = 0
        while heap:
            num, idx = heapq.heappop(heap)
            if nums[idx] == num:
                res += num
                nums[idx] = 0
                if idx: nums[idx-1] = 0
                if idx < n-1: nums[idx+1] = 0
        return res
```