题目如标题,答案是不是{B,C,BB,CC,BBC,BCC,BBCC},7个
请给出详细过程,谢谢!!!
8个吧 还有bc
strw = "BBCC"
strlen = len(strw)
resultSet = set(strw)
for m in range(1, strlen+1):
for n in range(strlen-m+1):
resultSet |= {strw[n:n+m]}
print(len(resultSet))
print(resultSet)