Added tree problem solution