`A:+-------+-------+   T: true|       |       |   F: false|   T   |   T   ||       |       |+-------+-------+|       |       ||   F   |   F   ||       |       |+-------+-------+topLeft: TtopRight: TbottomLeft: FbottomRight: F​B:               +-------+---+---+|       | F | F ||   T   +---+---+|       | T | T |+-------+---+---+|       |       ||   T   |   F   ||       |       |+-------+-------+topLeft: TtopRight:     topLeft: F     topRight: F     bottomLeft: T     bottomRight: TbottomLeft: TbottomRight: F​​你的任务是实现一个函数，该函数根据两个四叉树返回表示这两个四叉树的逻辑或(或并)的四叉树。​A:                 B:                 C (A or B):+-------+-------+  +-------+---+---+  +-------+-------+|       |       |  |       | F | F |  |       |       ||   T   |   T   |  |   T   +---+---+  |   T   |   T   ||       |       |  |       | T | T |  |       |       |+-------+-------+  +-------+---+---+  +-------+-------+|       |       |  |       |       |  |       |       ||   F   |   F   |  |   T   |   F   |  |   T   |   F   ||       |       |  |       |       |  |       |       |+-------+-------+  +-------+-------+  +-------+-------+`

A 和 B 都表示大小为 N * N 的网格。 N 将确保是 2 的整次幂。 如果你想了解更多关于四叉树的知识，你可以参考这个 wiki 页面。 逻辑或的定义如下：如果 A 为 True ，或者 B 为 True ，或者 A 和 B 都为 True，则 "A 或 B" 为 True。

`/*// Definition for a QuadTree node.class Node {public:    bool val;    bool isLeaf;    Node* topLeft;    Node* topRight;    Node* bottomLeft;    Node* bottomRight;​    Node() {}​    Node(bool _val, bool _isLeaf, Node* _topLeft, Node* _topRight, Node* _bottomLeft, Node* _bottomRight) {        val = _val;        isLeaf = _isLeaf;        topLeft = _topLeft;        topRight = _topRight;        bottomLeft = _bottomLeft;        bottomRight = _bottomRight;    }};*/class Solution {public:    Node* intersect(Node* quadTree1, Node* quadTree2) {        if(quadTree1->isLeaf) return quadTree1->val ? quadTree1 : quadTree2;        if(quadTree2->isLeaf) return quadTree2->val ? quadTree2 : quadTree1;        Node* topL = intersect(quadTree1->topLeft, quadTree2->topLeft);        Node* topR = intersect(quadTree1->topRight, quadTree2->topRight) ;        Node* bottomL = intersect(quadTree1->bottomLeft, quadTree2->bottomLeft);        Node* bottomR = intersect(quadTree1->bottomRight, quadTree2->bottomRight) ;        if(topL->isLeaf && topR->isLeaf && bottomL->isLeaf && bottomR->isLeaf && topL->val == topR->val && topL->val ==bottomL->val && topL->val == bottomR->val  ) return new Node(topL->val , true, NULL, NULL, NULL,NULL);​        return new Node(false, false, topL, topR, bottomL, bottomR);​    }};`