C# StringComparer.Ordinal. OMG
You have to use Ordinal order for the sorting.\nhttps://stackoverflow.com/questions/492799/difference-between-invariantculture-and-ordinal-string-comparison\n\n
You have to use Ordinal order for the sorting.\nhttps://stackoverflow.com/questions/492799/difference-between-invariantculture-and-ordinal-string-comparison\n\n```\n        public class Solution\n        {\n            public IList<IList<string>> DisplayTable(IList<IList<string>> orders)\n            {\n                var foodNameHash = new HashSet<string>();\n                var tableMap = new SortedDictionary<int, IDictionary<string, int>>();\n                foreach (var order in orders)\n                {\n                    int tableId = Convert.ToInt32(order[1]);\n                    string foodName = order[2];\n                    foodNameHash.Add(foodName);\n                    if (!tableMap.ContainsKey(tableId))\n                        tableMap.Add(tableId, new Dictionary<string, int>());\n                    if (!tableMap[tableId].ContainsKey(foodName))\n                        tableMap[tableId].Add(foodName, 1);\n                    else\n                        tableMap[tableId][foodName]++;\n                }\n\n                var res = new List<IList<string>>();\n                var foodNames = foodNameHash.OrderBy(x => x, StringComparer.Ordinal).ToList();\n                var len = foodNames.Count();\n                var row = new List<string>();\n                row.Add("Table");\n                foreach (string name in foodNames)\n                    row.Add(name);\n                res.Add(row);\n\n                foreach (var kp in tableMap)\n                {\n                    var tableId = kp.Key;\n                    var foodMap = tableMap[tableId];\n                    row = new List<string>();\n                    row.Add(tableId.ToString());\n                    for (int i = 0; i < len; i++)\n                    {\n                        if (foodMap.ContainsKey(foodNames[i]))\n                            row.Add(foodMap[foodNames[i]].ToString());\n                        else\n                            row.Add("0");\n                    }\n                    res.Add(row);\n                }\n\n                return res;\n            }\n        }\n```
[]