Pergunta de entrevista da empresa TuSimple

Code a function that takes in a tree and return true or false if all the values in that tree are the same.