Permutations: Difference between revisions

m
→‎{{header|C sharp|C#}}: Eliminated method call not included in source here
(→‎{{header|C sharp|C#}}: Added C# Recursive Linq Solution)
m (→‎{{header|C sharp|C#}}: Eliminated method call not included in source here)
Line 1,427:
{
if (values.Count() == 1)
return new [] {values.ToSingleton()};
return values.SelectMany(v => Permutations(values.ExceptWhere(x=> x != v.ToSingleton())),(v, p) => p.Prepend(v));
}</lang>
Usage