Ezvor

1612. Check If Two Expression Trees are Equivalent

MediumHash Table Preparing judge… LeetCode
Hash TableTreeDepth-First SearchBinary TreeCounting

Hints

Hint 1
Count for each variable how many times it appeared in the first tree.
Hint 2
Do the same for the second tree and check if the count is the same for both tree.