Better Balanced Binary Tree and Remove Duplicates from Sorted Array