Commit 921e6be6 authored by jxtxzzw's avatar jxtxzzw
Browse files

July 23

parent fccf4823
Pipeline #415 passed with stage
in 31 seconds
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
class Solution {
public TreeNode pruneTree(TreeNode root) {
if (root == null) {
return null;
} else if (root.val == 0 && root.left == null && root.right == null) {
return null;
}
root.left = pruneTree(root.left);
root.right = pruneTree(root.right);
if (root.val == 0 && root.left == null && root.right == null) {
return null;
} else {
return root;
}
}
}
......@@ -18,23 +18,23 @@ Use search to find what you want to see. Recommended to use https://record.jxtxz
---
共有记录 519 题 (records in total)
共有记录 520 题 (records in total)
+ CodeForces: 8
+ CSU: 1
+ EOJ: 196
+ HDU: 16
+ LeetCode: 208
+ LeetCode: 209
+ POJ: 13
+ UVa: 6
+ ZOJ: 1
+ 计蒜客: 68
+ 洛谷: 2
目前已整理代码 448 题 (with code and tags)
目前已整理代码 449 题 (with code and tags)
+ 172 题使用 C/C++ 编写 (solved with C/C++)
+ 268 题使用 Java 编写 (solved with Java)
+ 269 题使用 Java 编写 (solved with Java)
+ 1 题使用 Kotlin 编写 (solved with Kotlin)
+ 1 题使用 Python 编写 (solved with Python)
+ 5 题使用 Javascript 编写 (solved with Javascript)
......@@ -412,12 +412,13 @@ Use search to find what you want to see. Recommended to use https://record.jxtxz
| LeetCode | 733 | Flood Fill | | 深度优先搜索 | java |
| LeetCode | 739 | 每日温度 | 栈 | | java |
| LeetCode | 754 | Reach a Number | | | java |
| LeetCode | 765 | Couples Holding Hands | | 贪心 | java |
| LeetCode | 765 | Couples Holding Hands | | 贪心 | java |
| LeetCode | 771 | Jewels and Stones | | | js |
| LeetCode | 791 | Custom Sort String | | | java |
| LeetCode | 792 | Number of Matching Subsequences | | | java |
| LeetCode | 804 | Unique Morse Code Words | 集合 | | java |
| LeetCode | 815 | Bus Routes | | 广度优先搜索,优化 | java |
| LeetCode | 814 | Binary Tree Pruning | | 递归 | java |
| LeetCode | 815 | Bus Routes | | 广度优先搜索,优化 | java |
| LeetCode | 820 | Short Encoding of Words | 字典树 | 贪心 | java |
| LeetCode | 821 | Shortest Distance to a Character | | 贪心 | java |
| LeetCode | 823 | Binary Trees With Factors | | 动态规划 | java |
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment