1612. Check If Two Expression Trees are Equivalent
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.
Preparing judge…