![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
N_Young
这个作者很懒,什么都没留下…
展开
-
leetcode中文(一) #7反转整数,#77组合
这些题目对我来说,是在学习任务不重,没有什么代码打的时候保持手感的,所以没有按顺序刷题,有空看见有兴趣的就做一两道 #7 反转整数 class Solution { public: int reverse(int x) { bool tag = x <= 0; long ans; int tmp; x = abs(x); for (ans ...原创 2018-09-07 22:41:15 · 240 阅读 · 0 评论 -
leetcode(二) #104 #111 #107
#104 二叉树的最大深度 class Solution { public: int maxDepth(TreeNode* root) { if (root == NULL) return 0; int ans = getMaxDepth(root); return ans; } int getMaxDepth(TreeNode* root) { if...原创 2018-09-09 17:48:14 · 168 阅读 · 0 评论 -
leetcode(三) #112 #113
#112 路径总和 class Solution { public: bool hasPathSum(TreeNode* root, int sum) { if (root == NULL) return false; return checker(root, sum); } bool checker(TreeNode* root, int sum) { s...原创 2018-09-10 10:24:10 · 240 阅读 · 0 评论