Skip to content
Permalink
6d5cc671f5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
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