Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list<X> permute( list<X> x ) { list<X> r; while (!x.empty()) { auto i = random_upto(x.size()); r.insert(x[i]); x.erase(i); } return r; }
- list<X> permute( list<X> x ) { list<X> r; while (!x.empty()) { auto i = random_upto(x.size()); r.insert(x[i]); x.erase(i); } return r; }
Add Comment
Please, Sign In to add comment