/*** Definition for a binary tree node.* public class TreeNode {* int val;* TreeNode left;* TreeNode right;* TreeNode(int x) { val = x; }* }*/classSolution{int total=0;publicintsumNumbers(TreeNode root){if(root==null)return total;getSumNumbers(root,0);return total;}publicvoidgetSumNumbers(TreeNode root,int pre){//記錄父節點累加下來的值if(root==null)return;if(root.left==null&&root.right==null){//到達了葉子節點,統計總和total+=pre*10+root.val;return;}getSumNumbers(root.left,pre*10+root.val);getSumNumbers(root.right,pre*10+root.val);}}
fritz 使用手冊by Eric Hsiao蕭敬軒 Fritz對象檢測指南:使用機器學習在Android中構建寵物監控應用 (A guide to Object Detection with Fritz: Build a pet monitoring app in Android with machine learning) Whether it is detecting plant damage for farmers, …
2018年最新稅收分類編碼More than 31,000 people responded to our 2018 New Coder Survey, granting researchers an unprecedented glimpse into how adults are learning to code.超過31,000人對我們的2018年《新編碼器調查》做出了回應,使研究人員對成年人如何學…
by Derek Fong由德里克方(Derek Fong) 如何使用TypeScript和Webpack Hot Module Replacement構建Apollo GraphQL服務器 (How to build an Apollo GraphQL server with TypeScript and Webpack Hot Module Replacement) Let’s build an Apollo GraphQL Server with TypeScript…