Stellar Health interview question

Tree creation and manipulation check duplicates in 2d array