【发布时间】:2015-11-21 07:08:38
【问题描述】:
我正在尝试查找非常大字符串的子字符串并出现内存错误:
代码:
def substr(string):
le = []
st = list(string)
for s in xrange(len(string)+1):
for s1 in xrange(len(string)+1):
le.append(''.join(st[s:s1]))
cou = Counter(le)
cou_val = cou.keys()
cou_val.remove('')
return le, cou_val
在 substr 中,第 31 行的 ile "solution.py" 出现错误 le.append(''.join(st[s:s1])) 内存错误
如何解决这个问题?
【问题讨论】: