DEV Community

Discussion on: Daily Challenge #194 - Spread Number

Collapse
 
madstk1 profile image
Natamo • Edited

Late to the party, as always.

Func<int, int[]> SpreadNumber = (int n) => Enumerable.Range(1, n).ToArray();

Example:

foreach(int i in SpreadNumber(10)) {
    Console.WriteLine(i);
}