[LeetCode 366] Find Leaves of Binary Tree (Medium)
Givenabinarytree,collectatree'snodesasifyouweredoingthis:Collectandremoveallleaves,repeatuntilthetreeisempty.Example:Input:[1,2,3,4,5]1/\23/\45Output:[[4,5,3],[2],[1]]Solution:Bottom-up根据题目分析,可以发现,所有叶