ArmandXiao 发表于 2020-2-28 16:50
抱歉 我的 的确是9种
{:10_312:}
TJBEST 发表于 2020-2-25 15:48
先写一个可能会超时的,递归的,后面再想想别的方法优化
这个算法真牛掰,不但不超时,还是秒级别的
强,强
from itertools import combinations
def fun337(x):
result = list(set( + ))
for i in range(2,len(x)):
for j in combinations(x,i):
n = ''.join()
if n not in result:
result.append(n)
return len(result)