I have a variable called data that is defined as:
Dictionary<string[], Dictionary<string, float>> data
As you can see, the key is a string array and the value is another inner dictionary. Each key can have items like:
{"xxx", "ccc", "wpr", "qpr"}
{"xxx", "abd", "xyz", "qpr"}
{"yyy", "ddd", "kgo", "abc"}
How can I use LINQ to get the distinct first items of this key? For example, in my example above, I should get xxx and yyy as a result. Two of these keys have xxx and one has yyy as their first items.
The array of strings in the key of this Dictionary is used as a row identifier. The data that this Dictionary contains is data that is exported to Excel. I inherited this application so I cannot redefine this variable. So the key is used to identify and do a grouping of totals in Excel. This is why the original developer did it this way.
The string keys will always have the same length.