字符串的幂集运算:
例如“abc"的幂集为:
['', 'a', 'b', 'ab', 'c', 'ac', 'bc', 'abc']
def stringPowerSet(strs):
N = len(strs)
res = []
for i in range(2 ** N):
temp = ""
for j in range(N):
if (i>>j)%2:
temp+=strs[j]
res.append(temp)
return res
if __name__ == '__main__':
print(stringPowerSet("abc"))