fork(8) download
  1. using System;
  2. using System.Globalization;
  3. using System.Linq;
  4.  
  5. public class Program
  6. {
  7.  
  8. public static void Main(string[] args)
  9. {
  10. var currTermPairs = new []{ "A", "C", "AA", "B", "CC", "BB" };
  11.  
  12. string[][] allArrays = currTermPairs
  13. .Select((pair, index) => new { pair, index })
  14. .GroupBy(x => x.index % 2)
  15. .Select(g => g.Select(x => x.pair).ToArray())
  16. .ToArray();
  17.  
  18. foreach(var arr in allArrays)
  19. Console.WriteLine(string.Join(",",arr));
  20. }
  21. }
Success #stdin #stdout 0.05s 34216KB
stdin
Standard input is empty
stdout
A,AA,CC
C,B,BB