I am wondering how one can write a special Tally function, which treats the following list {{{1,0},{2,1,3}},{{1,1},{0,1,1}},{{2,1,2},{3,2}},{{1,0},{2,1}}}
as if:
- as long as dimensions match, it is equivalent. For example,
{{1,0},{2,1,3}}
and{{1,1},{0,1,1}}
are equivalent, but not with{{1,0},{2,1}}
. - ordering also does not matter. For example,
{{1,0},{2,1,3}}
and{{2,1,2},{3,2}}
are equivalent.
The elements of the level 1
list can be artitarily nested. How can I write such a function?
Many thanks.