标签:ecif oid ++ contain key void false div color
class MyHashSet { public: /** Initialize your data structure here. */ MyHashSet() { } void add(int key) { if(set[key] == 0) set[key]++; } void remove(int key) { if(set[key] > 0) set[key]--; } /** Returns true if this set contains the specified element */ bool contains(int key) { if(set[key] > 0) return true; return false; } private: int set[1000010] = {0}; };
标签:ecif oid ++ contain key void false div color
原文地址:https://www.cnblogs.com/asenyang/p/9734497.html