• + 5 comments

    I am confused by this problem. As best as I understand, the idea of the min-heap is that it is supposed to efficiently erase the top (minimum) element, but it is not supposed to be efficient at erasing an arbitrary element. On the other hand, I looked at other people's solutions, and they all implemented it using a set, which is not strictly speaking, correct because it would handle dublicate numbers differently. Nevertheless, the solution using a set passes all tests. Am I missing anything here?