Pergunta de entrevista da empresa Amazon

Online code with BST similar and a STAR question.