aboutsummaryrefslogtreecommitdiff
path: root/design_hashset.cpp
blob: 52d109720039db9556b1c2e357538c149039cd02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "leetcode.h"

class MyHashSet {
public:
  vector<bool> ans;
  MyHashSet() { ans.resize(1e6 + 1, false); }
  void add(int key) { ans[key] = true; }
  void remove(int key) { ans[key] = false; }
  bool contains(int key) { return ans[key]; }
};

int main() {}