JAVA | 97.7% fast | Using boolean Array
If you found the solution helpful, then kindly upvote. :)\n\n\nclass MyHashSet {\n\n/** Initialize your data structure here. */\nboolean[] arr;\n/** Initialize 
If you found the solution helpful, then kindly upvote. :)\n\n```\nclass MyHashSet {\n\n/** Initialize your data structure here. */\nboolean[] arr;\n/** Initialize your data structure here. */\npublic MyHashSet() {\n    arr = new boolean[1000000];\n}\n\npublic void add(int key) {\n    arr[key] = true;\n}\n\npublic void remove(int key) {\n    arr[key] = false;\n}\n\n/** Returns true if this set contains the specified element */\npublic boolean contains(int key) {\n    return arr[key];\n}\n}\n```
[]