Given a list of (frencuently repeated and unsorted) pairs
{Mode, SubMode}
I want to form the list
{
{COUNT_mode1, COUNT_mode2,...,COUNT_modeN},
{COUNT_mode1_submode1, COUNT_mode1,submode2, ... , COUNT_mdoe1,submodeM1, ... ,COUNT_modeN_submodeNM},
{mode1,mode2,...},
{submode1,submode2,...}
}
Here is an example, given:
l = { {"games","minecraft"},{"games","minecraft"},{"games","WoW"}, {"books","book1"},{"books","book1"},{"books","book1"},{"books","book5"},{"other","something"},{"other","book1"}}
MyFunction[l] -->
{
{3,4,2},
{2,1,3,1,1,1},
{"games","books","other"},
{"minecraft","WoW","book1","book5","something","book1"}
}