```
bool containsDuplicate(vector<int>& nums) {
if (nums.size() < 2) return false;
std::priority_queue<int, vector<int>, std::greater<int> > pq(nums.begin(), nums.end() );
int pre = pq.top();
int cur = 0;
pq.pop();
while(!pq.empty())
{
cur = pq.top();
pq.pop();
if (pre == cur)
return true;
pre = cur;
}
return false;
```