{"id":22513468,"url":"https://github.com/emahtab/design-hashset","last_synced_at":"2026-03-19T23:02:42.293Z","repository":{"id":79525428,"uuid":"479645642","full_name":"eMahtab/design-hashset","owner":"eMahtab","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-17T04:16:04.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T03:19:28.582Z","etag":null,"topics":["design","hashset","leetcode"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eMahtab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-09T06:57:34.000Z","updated_at":"2024-10-17T04:16:07.000Z","dependencies_parsed_at":"2023-06-03T06:45:53.812Z","dependency_job_id":null,"html_url":"https://github.com/eMahtab/design-hashset","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fdesign-hashset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fdesign-hashset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fdesign-hashset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fdesign-hashset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eMahtab","download_url":"https://codeload.github.com/eMahtab/design-hashset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245950660,"owners_count":20699106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design","hashset","leetcode"],"created_at":"2024-12-07T03:12:26.232Z","updated_at":"2026-01-06T18:08:00.666Z","avatar_url":"https://github.com/eMahtab.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Design HashSet\n## https://leetcode.com/problems/design-hashset\n\nDesign a HashSet without using any built-in hash table libraries.\n\nImplement MyHashSet class:\n```\nvoid add(key) Inserts the value key into the HashSet.\n\nbool contains(key) Returns whether the value key exists in the HashSet or not.\n\nvoid remove(key) Removes the value key in the HashSet. If key does not exist in the HashSet, do nothing.\n```\n\n## Implementation : Using ArrayList\n```java\nclass MyHashSet {\n    List\u003cInteger\u003e list;\n    public MyHashSet() {\n        list = new ArrayList\u003cInteger\u003e();\n    }\n    \n    public void add(int key) {\n        for(int num : list) {\n            if(num == key)\n                return;\n        }\n        list.add(key);\n    }\n    \n    public void remove(int key) {\n        list.remove(new Integer(key));\n    }\n    \n    public boolean contains(int key) {\n        return list.contains(key);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Fdesign-hashset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femahtab%2Fdesign-hashset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Fdesign-hashset/lists"}