static ArrayList digitalReorganization(string number)
{
IEnumerable<IEnumerable<int>> query = Enumerable.Range(0, number.Length).Select(x => new int[] { x });
for (int i = 1; i < number.Length; i++)
query = query.SelectMany(x => Enumerable.Range(0, number.Length).Where(y => !x.Contains(y)).Select(y => x.Concat(new int[] { y })));
ArrayList al = new ArrayList();
foreach (string s in query.Select(x => string.Join("", x.Select(y => number[y]))).Distinct())
al.Add(s);
return al;
}
{
IEnumerable<IEnumerable<int>> query = Enumerable.Range(0, number.Length).Select(x => new int[] { x });
for (int i = 1; i < number.Length; i++)
query = query.SelectMany(x => Enumerable.Range(0, number.Length).Where(y => !x.Contains(y)).Select(y => x.Concat(new int[] { y })));
ArrayList al = new ArrayList();
foreach (string s in query.Select(x => string.Join("", x.Select(y => number[y]))).Distinct())
al.Add(s);
return al;
}
我也是努力慢慢自学的..
版主也没必要这样伤人嘛,
有帮助到我的的贴自然会给分数。没有的我也没乱给, 这样也错了吗= =" 不过你说了,我就明白啦,下次一定给分的。
还有,感谢您的优化 ^^