Swappable Trees
Given two trees root0
and root1
, return whether you can transform root0
into root1
by swapping any node’s left and right subtrees any number of times.
https://binarysearch.com/problems/Swappable-Trees
Examples
Example 1
Input
- root0 =
- root1 =
Output
- answer =
True
Leave a comment