Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).

&nbsp;
Example 1:

Input: root = [1,2,2,3,4,4,3]
Output: true


Example 2:

Input: root = [1,2,2,null,3,null,3]
Output: false


&nbsp;
Constraints:


	The number of nodes in the tree is in the range [1, 1000].
	-100 &lt;= Node.val &lt;= 100


&nbsp;
Follow up: Could you solve it both recursively and iteratively?
class Solution:
    def isSymmetric(self, root: Optional[TreeNode]) -> bool:
        return root is None or self.findSymmetric(root.left, root.right)

    def findSymmetric(self, left, right):
        if (left is None or right is None):
            return left == right

        if (left.val != right.val):
            return False

        return self.findSymmetric(left.left, right.right) and self.findSymmetric(left.right, right.left)
class Solution {
    public boolean isSymmetric(TreeNode root) {
        return isSymmetric(root.left,root.right);
    }

    public boolean isSymmetric(TreeNode rootLeft, TreeNode rootRight) {
        if(rootLeft == null && rootRight == null) {return true;}
        if(rootLeft == null || rootRight == null) {return false;}
        if (rootLeft.val != rootRight.val) {return false;}
        else
            return isSymmetric(rootLeft.right, rootRight.left) && isSymmetric(rootLeft.left, rootRight.right);
    }
}
class Solution {
public:

    bool mirror(TreeNode* root1, TreeNode* root2){
        if(root1==NULL and root2==NULL) return true;
        if(root1==NULL or root2==NULL) return false;

        if(root1->val!=root2->val) return false;

        return mirror(root1->left, root2->right) and mirror(root1->right,root2->left);
    }

    bool isSymmetric(TreeNode* root) {
        if(root==NULL) return true;

        return mirror(root->left,root->right);
    }
};
var isSymmetric = function(root) {
    return helper(root.left, root.right);

    function helper(left, right){
        if(!left && !right) return true;
        if((!left && right) || (left && !right) || (left.val !== right.val)) return false;
        return helper(left.left, right.right) && helper(left.right, right.left)
    }
};
Symmetric Tree