https://gaviki.com/blog/python-multiset-implementation/