1
2
3
4
def prem(s,nx = [])
  return nx.join if s.empty?
  s.collect { |b| prem(s-[b],nx+[b]) }.flatten
...

Ruby Erlang Riddle for Rubists

by dorkalev, June 13, 2009 06:59, 3 refactorings, tagged with erlang, ruby, permutations

Originally published at htt...

0a5eb48929f4014d1a1bf448517158d5 Talk
1
2
3
4
#!/usr/bin/python2.5
def permute(li):
    """Generate all permutations of a sequence
...

Python Computing permutations with...

by Leif Ryge, October 22, 2008 04:16, 6 refactorings, tagged with generator, permutations, permutate, recursion

I suspect there is a better...

264124475f095b65634c53da3380b88d Talk