more compact recursive sol, but fails in the really-long-unbalanced tree