经典指数          
原因
1625
浏览数
0
收藏数
 

Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2->3which represents the number123. Find the total sum of all root-to-leaf numbers. For example, 1 / \ 2 3 The root-to-leaf path1->2represents the number12. The root-to-leaf path1->3represents the number13. Return the sum = 12 + 13 =25.

     举报   纠错  
 
切换
暂时还没有答案,欢迎分享你的解答 . . .
撰写答案
扫描后移动端查看本题