Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (26 sloc) 584 Bytes
L=[]
S=[]
with open("rosalind_cset.txt","rU") as f:
for line in f:
S.append(line.strip())
L.append(int(line.strip(),2))
l=len(S[0])
def flip(x):
return (~x)+(1<<(l))
def check(x,y):
if x&flip(y)!=0 and x&y!=0 and flip(x)&y!=0 and flip(x)&flip(y)!=0:
return False
else:
return True
jsave=0
for i,x in enumerate(L):
j=0
for k,y in enumerate(L):
if not check(x,y):
j+=1
if j>jsave:
bad=i
jsave=j
for i,x in enumerate(S):
if i!=bad:
print x
You can’t perform that action at this time.