java using singly linked list
\nclass Node {\n    int val;\n    Node next;\n    public Node(int val) {\n        this.val = val;\n        this.next = null;\n    }\n}\nclass MyHashSet {\n    N
```\nclass Node {\n    int val;\n    Node next;\n    public Node(int val) {\n        this.val = val;\n        this.next = null;\n    }\n}\nclass MyHashSet {\n    Node head;\n    public MyHashSet() {\n       head = null;\n    }\n    \n    public void add(int key) {\n        if(head == null) {\n            head = new Node(key);\n            return;\n        }\n        boolean isExist = contains(key);\n        if(!isExist) {\n            Node current = head;\n            while(current.next != null) {\n                current = current.next;\n            }\n            current.next = new Node(key);\n        }\n    }\n    \n    public void remove(int key) {\n        if(head == null) return;\n        if(head.val == key) {\n            head = head.next;\n            return;\n        }\n        Node current = head;\n        while(current.next != null) {\n            if(current.next.val == key) {\n                current.next = current.next.next;\n            } else {\n                current = current.next;\n            }\n        }\n    }\n    \n    /** Returns true if this set contains the specified element */\n    public boolean contains(int key) {\n        if(head == null) return false;\n        if(head.val == key) return true;\n        Node current = head;\n        while(current.next != null) {\n            if(current.next.val == key) {\n                return true;\n            }\n            current = current.next;\n        }\n        return false;\n    }\n}\n```
['Java']