Multiset Implementation Python Hackerrank Solution