Anagrams and valid bst done