Given an array of integers. Create a Binary Search Tree from these numbers. If the inserted value equals to the current node, insert it to the right subtree.
Write a method IsBalanced that determine if it is height-balanced. A height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
Write the code according to the next interface:
You can create (use) additional methods if needed.
The first line contains number n (1 ≤ n ≤ 100). The second line contains n integers.
Create the Binary Search Tree from input data. Print 1 if it is height-balanced and 0 otherwise.