using System.Collections.Generic;
public static void Main()
string[][] result = GroupByAnagram("top", "read", "act", "dear", "spot", "cat", "dare", "stop");
foreach(string[] anagramArray in result)
Console.WriteLine(string.Join(", ", anagramArray));
public static string[][] GroupByAnagram(params string[] str)
new []{"read", "dear", "dare"},