leetcode: add a standard template to solve tree code