Pergunta de entrevista da empresa Apollo.io

Two programming questions, one is about strings and other is about binary search trees