Sponsored
Use these hints if you're stuck. Try solving on your own first.
Count for each variable how many times it appeared in the first tree.
Do the same for the second tree and check if the count is the same for both tree.
Solve with full IDE support and test cases