🏆C++ || Easy o(1) solution
Code\n\nclass MyHashSet {\npublic:\n   vector<int>v;\n    MyHashSet() {\n        v.resize(1000000+10,0);\n    }\n    \n    void add(int key) {\n        v[key]=1
# Code\n```\nclass MyHashSet {\npublic:\n   vector<int>v;\n    MyHashSet() {\n        v.resize(1000000+10,0);\n    }\n    \n    void add(int key) {\n        v[key]=1;\n    }\n    \n    void remove(int key) {\n        v[key]=0;\n    }\n    \n    bool contains(int key) {\n        if(v[key])return true;\n        else return false;\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```\n![upvote (2).jpg](https://assets.leetcode.com/users/images/8b8d640e-1f0e-4333-894d-4a01259f6589_1685425108.9064975.jpeg)\n
['Array', 'Hash Table', 'Design', 'C++']