object not itterable
This commit is contained in:
parent
10dd9d25df
commit
ce050a911a
@ -1,26 +1,36 @@
|
|||||||
def __init__(self):
|
import random as r
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.set = {}
|
||||||
|
|
||||||
def insert(self, val):
|
def insert(self, val):
|
||||||
"""
|
"""
|
||||||
:type val: int
|
:type val: int
|
||||||
:rtype: bool
|
:rtype: bool
|
||||||
"""
|
"""
|
||||||
return True
|
if val is None:
|
||||||
|
return None
|
||||||
|
if val not in self:
|
||||||
|
self.add(val)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def remove(self, val):
|
def remove(self, val):
|
||||||
"""
|
"""
|
||||||
:type val: int
|
:type val: int
|
||||||
:rtype: bool
|
:rtype: bool
|
||||||
"""
|
"""
|
||||||
return False
|
if val not in self:
|
||||||
|
return False
|
||||||
|
self.discard(val)
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def getRandom(self):
|
def getRandom(self):
|
||||||
"""
|
"""
|
||||||
:rtype: int
|
:rtype: int
|
||||||
"""
|
"""
|
||||||
return getRandom
|
return r.self
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user