Back to problems

Nested Set Equality

Algorithm · Pinterest · Medium

You are given two nested sets, each represented as a list. Determine whether the two sets are equal, ignoring the order of elements at every level of nesting. Each element in a list is one of: A plain string (atomic element) Another list, which itself follows the same rules recursively (a nested subset) Two nested sets are considered equal when they contain exactly the same atomic strings and nested subsets, with the same nesting structure, regardless of how the elements are…

Checking your access…