fork download
  1. class MyHashMap:
  2. mymap = {}
  3. def __init__(self):
  4. self.mymap = {}
  5.  
  6. def put(self, key: int, value: int) -> None:
  7. self.mymap[key] = value
  8.  
  9. def get(self, key: int) -> int:
  10. if key not in self.mymap:
  11. return -1
  12. return self.mymap[key]
  13.  
  14. def remove(self, key: int) -> None:
  15. if key in self.mymap:
  16. self.mymap.pop(key)
  17.  
  18.  
  19.  
Success #stdin #stdout 0.08s 14112KB
stdin
Standard input is empty
stdout
Standard output is empty