thx!brianfry713 wrote:Input:AC output 3Code: Select all
4 1 2 1 2 2 1 1 3 3 1 1 4 4 0 0
I've already figure out that my algo will fail when the depth of the tree is more than 3.
So I compromise to Dfs,and then Ac in 25ms.
Thanks again for brianfry713's test sample!