If I have a sequence IEnumerable<T>
(not numbers, just T
):
[ a, b, c, d ]
How to return sort of Pascal's or Floyd's triangle:
a
ab
abc
abcd
so it would be IEnumerable<IEnumerable<T>>
?
Wondering whether there a way to achieve this elegantly using LINQ rather than implement manually using loops.