@anonymous/

FloweryScaryAfricanwilddog

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
def f(S,n):
 if n<1:return S
 a,b=[f({x[1:]for x in S if x[0]==c},n-1)for c in'01']
 return{'A'+y for y in a|b}|{'B'+y for y in a&b}

S=['000','001','010','011','100','101','110','111']
n=len(S[0])if S!=[]else 0
print f(S,n)