Sort list by count (occurance) or character count

Sort list by count (occurance) or character count

Wondering how to sort a list by either occurrence count or character count.
I have:
  1. toppfs = LP_inventory_form[AUCTION_TITLE_ROOT = input.AUCTION_TITLE_ROOT].Pressing_features.getAll().distinct();
  2. toppfs.sort(true);
  3. input.Pressing_features:ui.add(toppfs);
This sorts my list alphabetically of course. But I want to sort by:
A) Count of instances each element in toppfs occurs when AUCTION_TITLE_ROOT = input.AUCTION_TITLE_ROOT
or
B) By the character count of each element in toppfs