字母各异的全排列

def permutate(s):
	if not s:
		return [s]
	r = []
	for i in range(len(s)):
		for m in permutate(s[:i] + s[i+1:]):
			r.append(s[i:i+1] + m)
	return r

  

posted @ 2015-02-25 14:34  bitgirl_coder  阅读(163)  评论(0编辑  收藏  举报