后序遍历可以找到找到m到n的路径,是因为后序遍历的最后要返回m么。
你可以看看这篇博客:https://blog.csdn.net/qq_21449473/article/details/118379259
所以判断了一下:
if n == m: ans = 1 else: ans = 0