sorting a list of lists according to length frequency of sublists (b)