标签:
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array,
and it should return false if every element is distinct.
Subscribe to see which companies asked this question
c++ code:
class Solution { public: bool containsDuplicate(vector<int>& nums) { return set<int>(nums.begin(),nums.end()).size() < nums.size(); } };
标签:
原文地址:http://blog.csdn.net/itismelzp/article/details/51331294