My one test case is showing run error and others are passed can u correct my code and help me out

import java.util.*;
public class BinaryTree {

static Scanner scn = new Scanner(System.in);

public static void main(String[] args) {
	BinaryTree bt = new BinaryTree();
	System.out.println(bt.isBalanced());
}

	private class Node {
		int data;
		Node left;
		Node right;
	}

	private Node root;
	private int size;


	public BinaryTree() {
		this.root = this.takeInput(null, false);
	}

	public Node takeInput(Node parent, boolean ilc) {

		int cdata = scn.nextInt();
		Node child = new Node();
		child.data = cdata;
		this.size++;

		// left
		boolean hlc = scn.nextBoolean();

		if (hlc) {
			child.left = this.takeInput(child, true);
		}

		// right
		boolean hrc = scn.nextBoolean();

		if (hrc) {
			child.right = this.takeInput(child, false);
		}

		return child;
	}
    	public int  height() {
	return this.height(this.root);
	}
private int height(Node node) {
	if(node==null) {
		return -1;}
	int lheight= this.height(node.left);
	int rheight=this.height(node.right);
	int height= Math.max(lheight, rheight)+1;
	return height;
	
	}

	public boolean isBalanced() {
		return this.isBalanced(this.root);
	}

	private boolean isBalanced(Node node) {
		// write your code here
         
 
    int lh;

    int rh; 

    
    if (node == null) 
        return true; 

    
    lh = height(node.left); //left tree height
    rh = height(node.right); //right tree height

    if (Math.abs(lh - rh )<= 1
        && isBalanced(node.left) 
        && isBalanced(node.right)) 
        return true; 

    
    return false; 
}

bro ur code is fine
passed every test cases

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.