https://foxstack.blogspot.com/2022/05/python-multiset-implementation.html