Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
A permutation is a particular ordering of some list of objects. Problems tagged with permutation usually involve finding or generating permutations, including anagrams of text.
2
votes
Find imperfect anagrams
Python 3 - 447
Again, this is one of these programs that takes a long time to test, but I'll add one of the test cases once it's done.
from sys import*
l=argv
e=''
t=[]
v=list
n='\n'
g=open(l[3]).re …
5
votes
Sheffle tho vawols ureund!
Python 3, 109 bytes
Only supports lowercase vowels.
Thanks to @Alissa for saving an extra byte.
import re,random
def f(s):r='[aeiou]';a=re.findall(r,s);random.shuffle(a);return re.sub(r,lambda m:a. …
2
votes
Shuffle a mapping
Python 3, 107 bytes
Uses Python's native dictionary structure.
Thanks to @mbomb007 for saving a byte.
from random import*
def f(d,o={}):
i=list(d.values());shuffle(i)
for k in d.keys():o[k]=i.pop …