python的单例模式
class Solution:
# @return: The same instance of this class every time
__instance = None
def __init__(self):
pass
@classmethod
def getInstance(cls):
# write your code here
if Solution.__instance is None:
Solution.__instance = Solution()
return Solution.__instance
僵尸将臣

浙公网安备 33010602011771号