given a tree that contains only 0s and 1s convert it into a logical and tree a logical and tree is such that leftchild and rightchild andvalue given a tree that contains only 0s and 1s convert it into a logical and tree a logical and tree is such that left_child and right_child and_value
class Node:

    def __init__(self, val):
        self.val = val
        self.left = None
        self.right = None


def convert(root):
    if root is None:
        return 

    convert(root.left)
    convert(root.right)

    if root.left and root.right:
        root.val = root.left.val & root.right.val