solution to Maximum Depth of Binary Tree