Re: [閒聊] 每日leetcode已回收

看板Marginalman作者 (南爹摳打)時間1年前 (2024/04/15 17:30), 編輯推噓2(202)
留言4則, 4人參與, 1年前最新討論串121/1548 (看更多)
129. 求路徑上的數字字串合 C# code public class Solution { public int SumNumbers(TreeNode root, int num = 0) { if (root == null) return 0; num = num * 10 + root.val; if (root.left == null && root.right == null) return num; return SumNumbers(root.left, num) + SumNumbers(root.right, num); } } -- (づ′・ω・)づ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.220.51.52 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1713173453.A.0CA.html

04/15 17:31, 1年前 , 1F
大濕
04/15 17:31, 1F

04/15 17:31, 1年前 , 2F
大師
04/15 17:31, 2F

04/15 17:40, 1年前 , 3F
大師
04/15 17:40, 3F

04/15 17:44, 1年前 , 4F
大師
04/15 17:44, 4F
文章代碼(AID): #1c7FFD3A (Marginalman)
討論串 (同標題文章)
文章代碼(AID): #1c7FFD3A (Marginalman)