March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
|
|
@ -1,4 +1,3 @@
|
|||
from collections import Counter
|
||||
import random
|
||||
|
||||
def count(w1,wnew):
|
||||
|
|
@ -15,6 +14,7 @@ def best_shuffle(w):
|
|||
for j in rangej:
|
||||
if i != j and wnew[j] != wnew[i] and w[i] != wnew[j] and w[j] != wnew[i]:
|
||||
wnew[j], wnew[i] = wnew[i], wnew[j]
|
||||
break
|
||||
wnew = ''.join(wnew)
|
||||
return wnew, count(w, wnew)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue