Hi there @serhiy.storchaka,
Consider the case where one would calculate the k-combination of set S. When the set has `n` elements, the number of k-combination is equal to its binomial coefficient. e.g. ( n!/( (k!(n-k)! ).
One method of statistically optimising the computation is to remove n least common elements from the set S.
I do agree that this new method is merely for consistency because right now it is quite easy to simply do c.most_common(...)[:-(n+1):-1] to get th e least common elements.
The goal of this patch is to make it intuitive to get the least common elements of a Counter, therefore making it easy to remove them from a collection.
Does it make any sense to you? |