Java solution (99.7%)
We use a boolean array\n### A hashset can look up an item in O(1)\n\nTo implement a hashset, we need to use array-like memory blocks. \n\n#### Solution\n- We in
# We use a boolean array\n### A hashset can look up an item in O(1)\n\nTo implement a hashset, we need to use array-like memory blocks. \n\n#### Solution\n- We initialise a boolean array. By default ``` new boolean[10]``` results in all 10 elements given a default value of ```false```\n- To add an item to the set, we set its presence to ```true``` i.e. ```bool_array[item] = true;```. To remove it, we do  ```bool_array[item] = false;```\n- items range between 0 and 1000000. Initialising an array of length 1000000 is costly. So we initialise it to a medium range of values, say ```boolean[] bool_array = new boolean[m];```. If the key to be inserted is greater than m, we extend the length of the array on demand using ``` bool_array = Arrays.copy(bool_array,key+n);```\n- ```m ``` and ```n``` are the deciding factors in performance. low ```m``` means the initialization is fast, but chances of the key > m are high. setting n> 1 can reduce collisions, but larger n means more time to increase array size.\n\n```\nclass MyHashSet {\n    boolean[] arr = new boolean[100];// start with 100 elements for fast initialization\n    /** Initialize your data structure here. */\n    public MyHashSet() {\n        \n    }\n    \n    public void add(int key) {\n        if(key>=arr.length) // if array is too small to accomodate key, extend it.\n            extend(key);\n        arr[key]=true;\n    }\n    \n    public void remove(int key) {\n        if(key>=arr.length) // if array is too small to accomodate key, extend it.\n            extend(key);\n        arr[key]=false;\n    }\n    \n    /** Returns true if this set contains the specified element */\n    public boolean contains(int key) {\n        if(key>=arr.length) // key cannot be in array if array\'s length < key\n            return false;\n        return arr[key]==true;\n    }\n    \n    public void extend(int key){\n        arr= Arrays.copyOf(arr, key+2);  // extend array to one more item than necessary, we need "key" items. \n\t\t\t\t\t\t\t\t\t     // we give "key+1" items to reduce collisions.\n    }\n}\n```
[]