-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,438 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
*.java.hsp | ||
*.sonarj | ||
*.sw* | ||
.DS_Store | ||
.settings | ||
.springBeans | ||
bin | ||
build.sh | ||
integration-repo | ||
ivy-cache | ||
jxl.log | ||
jmx.log | ||
derby.log | ||
app.log | ||
spring-test/test-output/ | ||
.gradle | ||
argfile* | ||
activemq-data/ | ||
|
||
classes/ | ||
/build | ||
buildSrc/build | ||
/spring-*/build | ||
/spring-core/kotlin-coroutines/build | ||
/framework-bom/build | ||
/integration-tests/build | ||
/src/asciidoc/build | ||
target/ | ||
|
||
# Eclipse artifacts, including WTP generated manifests | ||
.classpath | ||
.project | ||
spring-*/src/main/java/META-INF/MANIFEST.MF | ||
|
||
# IDEA artifacts and output dirs | ||
*.iml | ||
*.log | ||
*.ipr | ||
*.iws | ||
.idea | ||
out | ||
test-output | ||
atlassian-ide-plugin.xml | ||
.gradletasknamecache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//给你一个字符串 s 和一个字符规律 p,请你来实现一个支持 '.' 和 '*' 的正则表达式匹配。 | ||
// | ||
// | ||
// '.' 匹配任意单个字符 | ||
// '*' 匹配零个或多个前面的那一个元素 | ||
// | ||
// | ||
// 所谓匹配,是要涵盖 整个 字符串 s的,而不是部分字符串。 | ||
// | ||
// 示例 1: | ||
// | ||
// | ||
//输入:s = "aa", p = "a" | ||
//输出:false | ||
//解释:"a" 无法匹配 "aa" 整个字符串。 | ||
// | ||
// | ||
// 示例 2: | ||
// | ||
// | ||
//输入:s = "aa", p = "a*" | ||
//输出:true | ||
//解释:因为 '*' 代表可以匹配零个或多个前面的那一个元素, 在这里前面的元素就是 'a'。因此,字符串 "aa" 可被视为 'a' 重复了一次。 | ||
// | ||
// | ||
// 示例 3: | ||
// | ||
// | ||
//输入:s = "ab", p = ".*" | ||
//输出:true | ||
//解释:".*" 表示可匹配零个或多个('*')任意字符('.')。 | ||
// | ||
// | ||
// | ||
// | ||
// 提示: | ||
// | ||
// | ||
// 1 <= s.length <= 20 | ||
// 1 <= p.length <= 20 | ||
// s 只包含从 a-z 的小写字母。 | ||
// p 只包含从 a-z 的小写字母,以及字符 . 和 *。 | ||
// 保证每次出现字符 * 时,前面都匹配到有效的字符 | ||
// | ||
// | ||
// Related Topics 递归 字符串 动态规划 👍 3628 👎 0 | ||
|
||
|
||
//leetcode submit region begin(Prohibit modification and deletion) | ||
class Solution { | ||
public boolean isMatch(String s, String p) { | ||
|
||
} | ||
} | ||
//leetcode submit region end(Prohibit modification and deletion) |
75 changes: 75 additions & 0 deletions
75
LeetCode/leetcode/leetcode/editor/cn/[129]求根节点到叶节点数字之和.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
//给你一个二叉树的根节点 root ,树中每个节点都存放有一个 0 到 9 之间的数字。 | ||
// | ||
// | ||
// | ||
// 每条从根节点到叶节点的路径都代表一个数字: | ||
// | ||
// | ||
// | ||
// | ||
// 例如,从根节点到叶节点的路径 1 -> 2 -> 3 表示数字 123 。 | ||
// | ||
// | ||
// 计算从根节点到叶节点生成的 所有数字之和 。 | ||
// | ||
// 叶节点 是指没有子节点的节点。 | ||
// | ||
// | ||
// | ||
// 示例 1: | ||
// | ||
// | ||
//输入:root = [1,2,3] | ||
//输出:25 | ||
//解释: | ||
//从根到叶子节点路径 1->2 代表数字 12 | ||
//从根到叶子节点路径 1->3 代表数字 13 | ||
//因此,数字总和 = 12 + 13 = 25 | ||
// | ||
// 示例 2: | ||
// | ||
// | ||
//输入:root = [4,9,0,5,1] | ||
//输出:1026 | ||
//解释: | ||
//从根到叶子节点路径 4->9->5 代表数字 495 | ||
//从根到叶子节点路径 4->9->1 代表数字 491 | ||
//从根到叶子节点路径 4->0 代表数字 40 | ||
//因此,数字总和 = 495 + 491 + 40 = 1026 | ||
// | ||
// | ||
// | ||
// | ||
// 提示: | ||
// | ||
// | ||
// 树中节点的数目在范围 [1, 1000] 内 | ||
// 0 <= Node.val <= 9 | ||
// 树的深度不超过 10 | ||
// | ||
// | ||
// Related Topics 树 深度优先搜索 二叉树 👍 632 👎 0 | ||
|
||
|
||
//leetcode submit region begin(Prohibit modification and deletion) | ||
/** | ||
* 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 int sumNumbers(TreeNode root) { | ||
|
||
} | ||
} | ||
//leetcode submit region end(Prohibit modification and deletion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
//罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。 | ||
// | ||
// | ||
//字符 数值 | ||
//I 1 | ||
//V 5 | ||
//X 10 | ||
//L 50 | ||
//C 100 | ||
//D 500 | ||
//M 1000 | ||
// | ||
// 例如, 罗马数字 2 写做 II ,即为两个并列的 1。12 写做 XII ,即为 X + II 。 27 写做 XXVII, 即为 XX + V + | ||
//II 。 | ||
// | ||
// 通常情况下,罗马数字中小的数字在大的数字的右边。但也存在特例,例如 4 不写做 IIII,而是 IV。数字 1 在数字 5 的左边,所表示的数等于大数 5 | ||
// 减小数 1 得到的数值 4 。同样地,数字 9 表示为 IX。这个特殊的规则只适用于以下六种情况: | ||
// | ||
// | ||
// I 可以放在 V (5) 和 X (10) 的左边,来表示 4 和 9。 | ||
// X 可以放在 L (50) 和 C (100) 的左边,来表示 40 和 90。 | ||
// C 可以放在 D (500) 和 M (1000) 的左边,来表示 400 和 900。 | ||
// | ||
// | ||
// 给你一个整数,将其转为罗马数字。 | ||
// | ||
// | ||
// | ||
// 示例 1: | ||
// | ||
// | ||
//输入: num = 3 | ||
//输出: "III" | ||
// | ||
// 示例 2: | ||
// | ||
// | ||
//输入: num = 4 | ||
//输出: "IV" | ||
// | ||
// 示例 3: | ||
// | ||
// | ||
//输入: num = 9 | ||
//输出: "IX" | ||
// | ||
// 示例 4: | ||
// | ||
// | ||
//输入: num = 58 | ||
//输出: "LVIII" | ||
//解释: L = 50, V = 5, III = 3. | ||
// | ||
// | ||
// 示例 5: | ||
// | ||
// | ||
//输入: num = 1994 | ||
//输出: "MCMXCIV" | ||
//解释: M = 1000, CM = 900, XC = 90, IV = 4. | ||
// | ||
// | ||
// | ||
// 提示: | ||
// | ||
// | ||
// 1 <= num <= 3999 | ||
// | ||
// | ||
// Related Topics 哈希表 数学 字符串 👍 1127 👎 0 | ||
|
||
|
||
//leetcode submit region begin(Prohibit modification and deletion) | ||
class Solution { | ||
public String intToRoman(int num) { | ||
|
||
} | ||
} | ||
//leetcode submit region end(Prohibit modification and deletion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//给你两个版本号 version1 和 version2 ,请你比较它们。 | ||
// | ||
// 版本号由一个或多个修订号组成,各修订号由一个 '.' 连接。每个修订号由 多位数字 组成,可能包含 前导零 。每个版本号至少包含一个字符。修订号从左到右编 | ||
//号,下标从 0 开始,最左边的修订号下标为 0 ,下一个修订号下标为 1 ,以此类推。例如,2.5.33 和 0.1 都是有效的版本号。 | ||
// | ||
// 比较版本号时,请按从左到右的顺序依次比较它们的修订号。比较修订号时,只需比较 忽略任何前导零后的整数值 。也就是说,修订号 1 和修订号 001 相等 。 | ||
//如果版本号没有指定某个下标处的修订号,则该修订号视为 0 。例如,版本 1.0 小于版本 1.1 ,因为它们下标为 0 的修订号相同,而下标为 1 的修订号分别 | ||
//为 0 和 1 ,0 < 1 。 | ||
// | ||
// 返回规则如下: | ||
// | ||
// | ||
// 如果 version1 > version2 返回 1, | ||
// 如果 version1 < version2 返回 -1, | ||
// 除此之外返回 0。 | ||
// | ||
// | ||
// | ||
// | ||
// 示例 1: | ||
// | ||
// | ||
//输入:version1 = "1.01", version2 = "1.001" | ||
//输出:0 | ||
//解释:忽略前导零,"01" 和 "001" 都表示相同的整数 "1" | ||
// | ||
// | ||
// 示例 2: | ||
// | ||
// | ||
//输入:version1 = "1.0", version2 = "1.0.0" | ||
//输出:0 | ||
//解释:version1 没有指定下标为 2 的修订号,即视为 "0" | ||
// | ||
// | ||
// 示例 3: | ||
// | ||
// | ||
//输入:version1 = "0.1", version2 = "1.1" | ||
//输出:-1 | ||
//解释:version1 中下标为 0 的修订号是 "0",version2 中下标为 0 的修订号是 "1" 。0 < 1,所以 version1 < | ||
//version2 | ||
// | ||
// | ||
// | ||
// | ||
// 提示: | ||
// | ||
// | ||
// 1 <= version1.length, version2.length <= 500 | ||
// version1 和 version2 仅包含数字和 '.' | ||
// version1 和 version2 都是 有效版本号 | ||
// version1 和 version2 的所有修订号都可以存储在 32 位整数 中 | ||
// | ||
// | ||
// Related Topics 双指针 字符串 👍 342 👎 0 | ||
|
||
|
||
//leetcode submit region begin(Prohibit modification and deletion) | ||
class Solution { | ||
public int compareVersion(String version1, String version2) { | ||
|
||
} | ||
} | ||
//leetcode submit region end(Prohibit modification and deletion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//给你一个整数数组 nums,有一个大小为 k 的滑动窗口从数组的最左侧移动到数组的最右侧。你只可以看到在滑动窗口内的 k 个数字。滑动窗口每次只向右移动一位 | ||
//。 | ||
// | ||
// 返回 滑动窗口中的最大值 。 | ||
// | ||
// | ||
// | ||
// 示例 1: | ||
// | ||
// | ||
//输入:nums = [1,3,-1,-3,5,3,6,7], k = 3 | ||
//输出:[3,3,5,5,6,7] | ||
//解释: | ||
//滑动窗口的位置 最大值 | ||
//--------------- ----- | ||
//[1 3 -1] -3 5 3 6 7 3 | ||
// 1 [3 -1 -3] 5 3 6 7 3 | ||
// 1 3 [-1 -3 5] 3 6 7 5 | ||
// 1 3 -1 [-3 5 3] 6 7 5 | ||
// 1 3 -1 -3 [5 3 6] 7 6 | ||
// 1 3 -1 -3 5 [3 6 7] 7 | ||
// | ||
// | ||
// 示例 2: | ||
// | ||
// | ||
//输入:nums = [1], k = 1 | ||
//输出:[1] | ||
// | ||
// | ||
// | ||
// | ||
// 提示: | ||
// | ||
// | ||
// 1 <= nums.length <= 10⁵ | ||
// -10⁴ <= nums[i] <= 10⁴ | ||
// 1 <= k <= nums.length | ||
// | ||
// | ||
// Related Topics 队列 数组 滑动窗口 单调队列 堆(优先队列) 👍 2076 👎 0 | ||
|
||
|
||
//leetcode submit region begin(Prohibit modification and deletion) | ||
class Solution { | ||
public int[] maxSlidingWindow(int[] nums, int k) { | ||
|
||
} | ||
} | ||
//leetcode submit region end(Prohibit modification and deletion) |
Oops, something went wrong.