public static IEnumerable<string> GetPermutations(string s){ if (s.Length > 1) return from ch in s from permutation in GetPermutations(s.Remove(s.IndexOf(ch), 1)) select string.Format("{0}{1}", ch, permutation); else return new string[] { s };}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)