I have a flat list of some names in a random order. Is it possible to write a single LINQ statement to create a tree hierarchy in JSON so that they would be grouped according to the rules illustrated by the example below:
Input:
"Banana", "Apple", "Cheery", "Lemon", "Orange", ...
Output:
{
"A, B, C": "Apple, Banana, Cherry",
"D, E, F" : "",
...
"J, L, M": "Lemon",
"N, O, P": "Orange",
...
}