This question is slightly different from here
I have an array of numbers where I want to produce a list of segments. The end of the segment is included as the beginning element of the next segment. I want each segment to have 3 (in this example) points each. Here's an illustration:
var origArray = new[] {1,2,3,4,5,6};
I want the result to be:
{ {1,2,3}, {3,4,5}, {5,6} }
A traditional for-loop could accomplish this, but just wondering if somebody did this in a LINQy way.