[ C++ ] [ Using Simple Vector ]
Code\n\nclass MyHashSet {\npublic:\n        vector<bool> ans;\n    MyHashSet() {\n        ans.resize(1e6+1,false);\n    }\n    \n    void add(int key) {\n      
# Code\n```\nclass MyHashSet {\npublic:\n        vector<bool> ans;\n    MyHashSet() {\n        ans.resize(1e6+1,false);\n    }\n    \n    void add(int key) {\n        ans[key]=true;\n    }\n    \n    void remove(int key) {\n        ans[key]=false;\n    }\n    \n    bool contains(int key) {\n        return ans[key];\n    }\n};\n\n/**\n * Your MyHashSet object will be instantiated and called as such:\n * MyHashSet* obj = new MyHashSet();\n * obj->add(key);\n * obj->remove(key);\n * bool param_3 = obj->contains(key);\n */\n```
['C++']