leetcode时有道题要求输出的列表是[1,0],但是标准输出只能是[1, 0],并且我的代码在本地能跑 ,在leetcode就跑不动报错了
leetcode第一题就难住我了啊,从入门到放弃,求支援
a = eval(input())
b = int(input())
for i in a :
if b-i not in a:
pass
else:
c = a.index(i)
d = a.index(b-i)
list1 = []
list1.append(d)
list1.append(c)
print(list1)
执行出错信息:
NameError: name 'Solution' is not defined
ret = Solution().twoSum(param_1, param_2)
Line 40 in _driver (Solution.py)
_driver()
Line 51 in (Solution.py)