Start of 380
This commit is contained in:
parent
2bb5fc48da
commit
f61d54b662
29
Top150Interview/380InsertDeleteGetRandomO1.py
Normal file
29
Top150Interview/380InsertDeleteGetRandomO1.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
def __init__(self):
|
||||||
|
|
||||||
|
|
||||||
|
def insert(self, val):
|
||||||
|
"""
|
||||||
|
:type val: int
|
||||||
|
:rtype: bool
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def remove(self, val):
|
||||||
|
"""
|
||||||
|
:type val: int
|
||||||
|
:rtype: bool
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def getRandom(self):
|
||||||
|
"""
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Your RandomizedSet object will be instantiated and called as such:
|
||||||
|
# obj = RandomizedSet()
|
||||||
|
# param_1 = obj.insert(val)
|
||||||
|
# param_2 = obj.remove(val)
|
||||||
|
# param_3 = obj.getRandom()
|
||||||
Loading…
Reference in New Issue
Block a user