MaxDepth Java Solved