Language Java1.Write method called unique, which takes an array of int, then return the same int with duplicates removed without using any JCF or other classes.2.Given a binary tree, determine if it is height-balanced.For this problem, 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.Use following Node class, no height is stored in the Node/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; *
PayPal Gateway not configured
PayPal Gateway not configured