Solution for simple tree height