2 An example.

Tally[list,test] can use a custom function test to judge if elements are equal. But the output will only give the first element in a group. Is there an option to give all the elements? Or how do I write a custom function to do this?

E.g. Given {{1,1},{1,2},{1,2,3},{2,3}}, a tally with test set to head equality would give {{{1,1},3},{{2,3},1}}, but I want something like {{3,{1,1},{1,2},{1,2,3}},{1,{2,3}}}.

Tally[list,test] can use a custom function test to judge if elements are equal. But the output will only give the first element in a group. Is there an option to give all the elements? Or how do I write a custom function to do this?

Tally[list,test] can use a custom function test to judge if elements are equal. But the output will only give the first element in a group. Is there an option to give all the elements? Or how do I write a custom function to do this?

E.g. Given {{1,1},{1,2},{1,2,3},{2,3}}, a tally with test set to head equality would give {{{1,1},3},{{2,3},1}}, but I want something like {{3,{1,1},{1,2},{1,2,3}},{1,{2,3}}}.

1

# List all "duplicate" elements in Tally

Tally[list,test] can use a custom function test to judge if elements are equal. But the output will only give the first element in a group. Is there an option to give all the elements? Or how do I write a custom function to do this?