0
blog.revfad.com · 29d · discuss
As demonstrated above, collections.Counter.most_common orders elements with equal counts in order of first appearance: “Elements with equal counts are ordered in the order first encountered”. But == looks at set equality. Handy for checking for palindromes without doing a sort (and so hopefully O(n) vs O(n log n)): Counter(s) == Counter(t). Just slightly disconcerting to […]