Dicts and lists can't be used as dict keys or set members. Implement freeze(obj) that converts a nested structure into a hashable, immutable equivalent:
dict → frozenset of (key, frozen_value) pairslist / tuple → tuple of frozen itemsset → frozenset of frozen itemsUnlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial