Re: [閒聊] 每日leetcode

作者: sustainer123 (caster)   2024-04-15 09:34:01
※ 引述《Rushia (早瀬ユウカの体操服 )》之銘言:
: 129. Sum Root to Leaf Numbers
: https://leetcode.com/problems/sum-root-to-leaf-numbers/description
: 給你一個二元樹,求出所有的root到leaf節點的路徑數字和。
: 思路:
: 1.普通dfs紀錄路徑中的數字和,如果當前點是leaf就累加。
: py code:
:
作者: SecondRun (雨夜琴聲)   2024-04-15 11:28:00
大師

Links booklink

Contact Us: admin [ a t ] ucptt.com