Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
skill_tree_algorithm
提交
a31cdcee
S
skill_tree_algorithm
项目概览
CSDN 技术社区
/
skill_tree_algorithm
通知
9
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skill_tree_algorithm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a31cdcee
编写于
11月 09, 2021
作者:
F
feilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix exercise_id gen bug
上级
ceaae444
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
470 addition
and
176 deletion
+470
-176
data/2.算法中阶/5.leetcode-排序算法/911.排序数组/solution.json
data/2.算法中阶/5.leetcode-排序算法/911.排序数组/solution.json
+7
-0
data/tree.json
data/tree.json
+448
-169
src/tree.py
src/tree.py
+15
-7
未找到文件。
data/2.算法中阶/5.leetcode-排序算法/911.排序数组/solution.json
0 → 100644
浏览文件 @
a31cdcee
{
"type"
:
"code_options"
,
"author"
:
"CSDN.net"
,
"source"
:
"solution.md"
,
"exercise_id"
:
"b6c1d63886f5439e8f7be9e1aa956ba6"
}
\ No newline at end of file
data/tree.json
浏览文件 @
a31cdcee
...
...
@@ -21,7 +21,8 @@
"分数"
],
"children"
:
[]
}
},
"origin_num"
:
3
},
{
"等差素数列"
:
{
...
...
@@ -31,7 +32,8 @@
"等差素数列"
],
"children"
:
[]
}
},
"origin_num"
:
4
},
{
"乘积尾零"
:
{
...
...
@@ -41,7 +43,8 @@
"乘积尾零"
],
"children"
:
[]
}
},
"origin_num"
:
24
},
{
"成绩分析"
:
{
...
...
@@ -51,7 +54,8 @@
"成绩分析"
],
"children"
:
[]
}
},
"origin_num"
:
40
},
{
"乘积最大"
:
{
...
...
@@ -61,7 +65,8 @@
"乘积最大"
],
"children"
:
[]
}
},
"origin_num"
:
41
},
{
"猜年龄"
:
{
...
...
@@ -71,7 +76,8 @@
"猜年龄"
],
"children"
:
[]
}
},
"origin_num"
:
67
},
{
"递增三元组"
:
{
...
...
@@ -81,7 +87,8 @@
"递增三元组"
],
"children"
:
[]
}
},
"origin_num"
:
69
},
{
"第几个幸运数"
:
{
...
...
@@ -91,7 +98,8 @@
"第几个幸运数"
],
"children"
:
[]
}
},
"origin_num"
:
77
},
{
"次数差"
:
{
...
...
@@ -101,7 +109,8 @@
"次数差"
],
"children"
:
[]
}
},
"origin_num"
:
88
},
{
"猜字母"
:
{
...
...
@@ -111,7 +120,8 @@
"猜字母"
],
"children"
:
[]
}
},
"origin_num"
:
99
},
{
"第39级台阶"
:
{
...
...
@@ -121,7 +131,8 @@
"第39级台阶"
],
"children"
:
[]
}
},
"origin_num"
:
100
},
{
"9数算式"
:
{
...
...
@@ -131,7 +142,8 @@
"9数算式"
],
"children"
:
[]
}
},
"origin_num"
:
104
},
{
"错误票据"
:
{
...
...
@@ -141,7 +153,8 @@
"错误票据"
],
"children"
:
[]
}
},
"origin_num"
:
106
},
{
"大数乘法"
:
{
...
...
@@ -151,7 +164,8 @@
"大数乘法"
],
"children"
:
[]
}
},
"origin_num"
:
112
},
{
"大衍数列"
:
{
...
...
@@ -161,7 +175,8 @@
"大衍数列"
],
"children"
:
[]
}
},
"origin_num"
:
114
},
{
"成绩统计"
:
{
...
...
@@ -171,7 +186,8 @@
"成绩统计"
],
"children"
:
[]
}
},
"origin_num"
:
120
},
{
"比酒量"
:
{
...
...
@@ -181,7 +197,8 @@
"比酒量"
],
"children"
:
[]
}
},
"origin_num"
:
126
},
{
"第几天"
:
{
...
...
@@ -191,7 +208,8 @@
"第几天"
],
"children"
:
[]
}
},
"origin_num"
:
134
},
{
"斐波那契"
:
{
...
...
@@ -201,7 +219,8 @@
"斐波那契"
],
"children"
:
[]
}
},
"origin_num"
:
135
},
{
"方阵转置"
:
{
...
...
@@ -211,7 +230,8 @@
"方阵转置"
],
"children"
:
[]
}
},
"origin_num"
:
149
},
{
"倍数问题"
:
{
...
...
@@ -221,7 +241,8 @@
"倍数问题"
],
"children"
:
[]
}
},
"origin_num"
:
158
}
]
}
...
...
@@ -239,7 +260,8 @@
"单词分析"
],
"children"
:
[]
}
},
"origin_num"
:
92
},
{
"分类计数"
:
{
...
...
@@ -249,7 +271,8 @@
"分类计数"
],
"children"
:
[]
}
},
"origin_num"
:
97
},
{
"翻硬币"
:
{
...
...
@@ -259,7 +282,8 @@
"翻硬币"
],
"children"
:
[]
}
},
"origin_num"
:
98
}
]
}
...
...
@@ -277,7 +301,8 @@
"抽签"
],
"children"
:
[]
}
},
"origin_num"
:
35
},
{
"打印图形"
:
{
...
...
@@ -287,7 +312,8 @@
"打印图形"
],
"children"
:
[]
}
},
"origin_num"
:
58
},
{
"带分数"
:
{
...
...
@@ -297,7 +323,8 @@
"带分数"
],
"children"
:
[]
}
},
"origin_num"
:
143
},
{
"等差数列"
:
{
...
...
@@ -307,7 +334,8 @@
"等差数列"
],
"children"
:
[]
}
},
"origin_num"
:
163
}
]
}
...
...
@@ -325,7 +353,8 @@
"堆的计数"
],
"children"
:
[]
}
},
"origin_num"
:
124
}
]
}
...
...
@@ -350,7 +379,8 @@
"方程整数解"
],
"children"
:
[]
}
},
"origin_num"
:
14
},
{
"放棋子"
:
{
...
...
@@ -360,7 +390,8 @@
"放棋子"
],
"children"
:
[]
}
},
"origin_num"
:
23
},
{
"分巧克力"
:
{
...
...
@@ -370,7 +401,8 @@
"分巧克力"
],
"children"
:
[]
}
},
"origin_num"
:
28
},
{
"等腰三角形"
:
{
...
...
@@ -380,7 +412,8 @@
"等腰三角形"
],
"children"
:
[]
}
},
"origin_num"
:
53
},
{
"分糖果"
:
{
...
...
@@ -390,7 +423,8 @@
"分糖果"
],
"children"
:
[]
}
},
"origin_num"
:
54
},
{
"方格填数"
:
{
...
...
@@ -400,7 +434,8 @@
"方格填数"
],
"children"
:
[]
}
},
"origin_num"
:
63
},
{
"夺冠概率"
:
{
...
...
@@ -410,7 +445,8 @@
"夺冠概率"
],
"children"
:
[]
}
},
"origin_num"
:
137
},
{
"7段码"
:
{
...
...
@@ -420,7 +456,8 @@
"7段码"
],
"children"
:
[]
}
},
"origin_num"
:
162
},
{
"颠倒的价牌"
:
{
...
...
@@ -430,7 +467,8 @@
"颠倒的价牌"
],
"children"
:
[]
}
},
"origin_num"
:
175
},
{
"承压计算"
:
{
...
...
@@ -440,7 +478,8 @@
"承压计算"
],
"children"
:
[]
}
},
"origin_num"
:
187
}
]
}
...
...
@@ -458,7 +497,8 @@
"搭积木"
],
"children"
:
[]
}
},
"origin_num"
:
6
},
{
"分配口罩"
:
{
...
...
@@ -468,7 +508,8 @@
"分配口罩"
],
"children"
:
[]
}
},
"origin_num"
:
51
},
{
"方格分割"
:
{
...
...
@@ -478,7 +519,8 @@
"方格分割"
],
"children"
:
[]
}
},
"origin_num"
:
65
},
{
"超级胶水"
:
{
...
...
@@ -488,7 +530,8 @@
"超级胶水"
],
"children"
:
[]
}
},
"origin_num"
:
121
},
{
"凑算式"
:
{
...
...
@@ -498,7 +541,8 @@
"凑算式"
],
"children"
:
[]
}
},
"origin_num"
:
156
},
{
"大臣的旅费"
:
{
...
...
@@ -508,7 +552,8 @@
"大臣的旅费"
],
"children"
:
[]
}
},
"origin_num"
:
188
}
]
}
...
...
@@ -533,7 +578,8 @@
"测试次数"
],
"children"
:
[]
}
},
"origin_num"
:
91
},
{
"地宫取宝"
:
{
...
...
@@ -543,7 +589,8 @@
"地宫取宝"
],
"children"
:
[]
}
},
"origin_num"
:
117
}
]
}
...
...
@@ -590,7 +637,8 @@
"两数之和"
],
"children"
:
[]
}
},
"origin_num"
:
0
},
{
"寻找两个正序数组的中位数"
:
{
...
...
@@ -600,7 +648,8 @@
"寻找两个正序数组的中位数"
],
"children"
:
[]
}
},
"origin_num"
:
3
},
{
"三数之和"
:
{
...
...
@@ -610,7 +659,8 @@
"三数之和"
],
"children"
:
[]
}
},
"origin_num"
:
14
},
{
"四数之和"
:
{
...
...
@@ -620,7 +670,8 @@
"四数之和"
],
"children"
:
[]
}
},
"origin_num"
:
17
},
{
"搜索旋转排序数组"
:
{
...
...
@@ -630,7 +681,8 @@
"搜索旋转排序数组"
],
"children"
:
[]
}
},
"origin_num"
:
32
},
{
"在排序数组中查找元素的第一个和最后一个位置"
:
{
...
...
@@ -640,7 +692,8 @@
"在排序数组中查找元素的第一个和最后一个位置"
],
"children"
:
[]
}
},
"origin_num"
:
33
},
{
"搜索插入位置"
:
{
...
...
@@ -650,7 +703,8 @@
"搜索插入位置"
],
"children"
:
[]
}
},
"origin_num"
:
34
},
{
"旋转图像"
:
{
...
...
@@ -660,7 +714,8 @@
"旋转图像"
],
"children"
:
[]
}
},
"origin_num"
:
47
},
{
"螺旋矩阵"
:
{
...
...
@@ -670,7 +725,8 @@
"螺旋矩阵"
],
"children"
:
[]
}
},
"origin_num"
:
53
},
{
"合并区间"
:
{
...
...
@@ -680,7 +736,8 @@
"合并区间"
],
"children"
:
[]
}
},
"origin_num"
:
55
},
{
"插入区间"
:
{
...
...
@@ -690,7 +747,8 @@
"插入区间"
],
"children"
:
[]
}
},
"origin_num"
:
56
},
{
"螺旋矩阵 II"
:
{
...
...
@@ -700,7 +758,8 @@
"螺旋矩阵 II"
],
"children"
:
[]
}
},
"origin_num"
:
58
},
{
"矩阵置零"
:
{
...
...
@@ -710,7 +769,8 @@
"矩阵置零"
],
"children"
:
[]
}
},
"origin_num"
:
72
},
{
"搜索二维矩阵"
:
{
...
...
@@ -720,7 +780,8 @@
"搜索二维矩阵"
],
"children"
:
[]
}
},
"origin_num"
:
73
},
{
"子集"
:
{
...
...
@@ -730,7 +791,8 @@
"子集"
],
"children"
:
[]
}
},
"origin_num"
:
77
},
{
"删除有序数组中的重复项 II"
:
{
...
...
@@ -740,7 +802,8 @@
"删除有序数组中的重复项 II"
],
"children"
:
[]
}
},
"origin_num"
:
79
},
{
"搜索旋转排序数组 II"
:
{
...
...
@@ -750,7 +813,8 @@
"搜索旋转排序数组 II"
],
"children"
:
[]
}
},
"origin_num"
:
80
}
]
}
...
...
@@ -768,7 +832,8 @@
"两数相加"
],
"children"
:
[]
}
},
"origin_num"
:
1
},
{
"删除链表的倒数第 N 个结点"
:
{
...
...
@@ -778,7 +843,8 @@
"删除链表的倒数第 N 个结点"
],
"children"
:
[]
}
},
"origin_num"
:
18
},
{
"合并两个有序链表"
:
{
...
...
@@ -788,7 +854,8 @@
"合并两个有序链表"
],
"children"
:
[]
}
},
"origin_num"
:
20
},
{
"合并K个升序链表"
:
{
...
...
@@ -798,7 +865,8 @@
"合并K个升序链表"
],
"children"
:
[]
}
},
"origin_num"
:
22
},
{
"两两交换链表中的节点"
:
{
...
...
@@ -808,7 +876,8 @@
"两两交换链表中的节点"
],
"children"
:
[]
}
},
"origin_num"
:
23
},
{
"K 个一组翻转链表"
:
{
...
...
@@ -818,7 +887,8 @@
"K 个一组翻转链表"
],
"children"
:
[]
}
},
"origin_num"
:
24
},
{
"删除排序链表中的重复元素 II"
:
{
...
...
@@ -828,7 +898,8 @@
"删除排序链表中的重复元素 II"
],
"children"
:
[]
}
},
"origin_num"
:
81
},
{
"删除排序链表中的重复元素"
:
{
...
...
@@ -838,7 +909,8 @@
"删除排序链表中的重复元素"
],
"children"
:
[]
}
},
"origin_num"
:
82
},
{
"分隔链表"
:
{
...
...
@@ -848,7 +920,8 @@
"分隔链表"
],
"children"
:
[]
}
},
"origin_num"
:
85
},
{
"反转链表 II"
:
{
...
...
@@ -858,7 +931,8 @@
"反转链表 II"
],
"children"
:
[]
}
},
"origin_num"
:
91
}
]
}
...
...
@@ -876,7 +950,8 @@
"无重复字符的最长子串"
],
"children"
:
[]
}
},
"origin_num"
:
2
},
{
"Z 字形变换"
:
{
...
...
@@ -886,7 +961,8 @@
"Z 字形变换"
],
"children"
:
[]
}
},
"origin_num"
:
5
},
{
"字符串转换整数 (atoi)"
:
{
...
...
@@ -896,7 +972,8 @@
"字符串转换整数 (atoi)"
],
"children"
:
[]
}
},
"origin_num"
:
7
},
{
"最长公共前缀"
:
{
...
...
@@ -906,7 +983,8 @@
"最长公共前缀"
],
"children"
:
[]
}
},
"origin_num"
:
13
},
{
"实现 strStr()"
:
{
...
...
@@ -916,7 +994,8 @@
"实现 strStr()"
],
"children"
:
[]
}
},
"origin_num"
:
27
},
{
"外观数列"
:
{
...
...
@@ -926,7 +1005,8 @@
"外观数列"
],
"children"
:
[]
}
},
"origin_num"
:
37
},
{
"字符串相乘"
:
{
...
...
@@ -936,7 +1016,8 @@
"字符串相乘"
],
"children"
:
[]
}
},
"origin_num"
:
42
},
{
"最后一个单词的长度"
:
{
...
...
@@ -946,7 +1027,8 @@
"最后一个单词的长度"
],
"children"
:
[]
}
},
"origin_num"
:
57
},
{
"有效数字"
:
{
...
...
@@ -956,7 +1038,8 @@
"有效数字"
],
"children"
:
[]
}
},
"origin_num"
:
64
},
{
"复原 IP 地址"
:
{
...
...
@@ -966,7 +1049,8 @@
"复原 IP 地址"
],
"children"
:
[]
}
},
"origin_num"
:
92
},
{
"交错字符串"
:
{
...
...
@@ -976,7 +1060,8 @@
"交错字符串"
],
"children"
:
[]
}
},
"origin_num"
:
96
}
]
}
...
...
@@ -994,7 +1079,8 @@
"有效的括号"
],
"children"
:
[]
}
},
"origin_num"
:
19
},
{
"最长有效括号"
:
{
...
...
@@ -1004,7 +1090,8 @@
"最长有效括号"
],
"children"
:
[]
}
},
"origin_num"
:
31
},
{
"接雨水"
:
{
...
...
@@ -1014,7 +1101,8 @@
"接雨水"
],
"children"
:
[]
}
},
"origin_num"
:
41
},
{
"简化路径"
:
{
...
...
@@ -1024,7 +1112,8 @@
"简化路径"
],
"children"
:
[]
}
},
"origin_num"
:
70
},
{
"柱状图中最大的矩形"
:
{
...
...
@@ -1034,7 +1123,8 @@
"柱状图中最大的矩形"
],
"children"
:
[]
}
},
"origin_num"
:
83
},
{
"逆波兰表达式求值"
:
{
...
...
@@ -1044,7 +1134,19 @@
"逆波兰表达式求值"
],
"children"
:
[]
}
},
"origin_num"
:
149
},
{
"最小栈"
:
{
"node_id"
:
"algorithm-e390d7a141d94907930a50469baa0cfa"
,
"keywords"
:
[
"leetcode"
,
"最小栈"
],
"children"
:
[]
},
"origin_num"
:
154
},
{
"天际线问题"
:
{
...
...
@@ -1054,7 +1156,30 @@
"天际线问题"
],
"children"
:
[]
}
},
"origin_num"
:
217
},
{
"基本计算器"
:
{
"node_id"
:
"algorithm-56c34a1192d0451cb982e456a82c5c6d"
,
"keywords"
:
[
"leetcode"
,
"基本计算器"
],
"children"
:
[]
},
"origin_num"
:
223
},
{
"基本计算器 II"
:
{
"node_id"
:
"algorithm-c75a176a776a4b2d87cf2be7102b49b7"
,
"keywords"
:
[
"leetcode"
,
"基本计算器 II"
],
"children"
:
[]
},
"origin_num"
:
226
}
]
}
...
...
@@ -1064,6 +1189,17 @@
"node_id"
:
"algorithm-23e9e4c3b7a147299c16ebd6d25dd23b"
,
"keywords"
:
[],
"children"
:
[
{
"最大间距"
:
{
"node_id"
:
"algorithm-e7fb5d6455fe490dbffe4b5cac8a5b95"
,
"keywords"
:
[
"leetcode"
,
"最大间距"
],
"children"
:
[]
},
"origin_num"
:
163
},
{
"H 指数"
:
{
"node_id"
:
"algorithm-9e8294b8930c462fb54eba9c47a8ecfd"
,
...
...
@@ -1072,7 +1208,19 @@
"H 指数"
],
"children"
:
[]
}
},
"origin_num"
:
273
},
{
"计算右侧小于当前元素的个数"
:
{
"node_id"
:
"algorithm-4b5f859d4b83448e81381353bc1eba4c"
,
"keywords"
:
[
"leetcode"
,
"计算右侧小于当前元素的个数"
],
"children"
:
[]
},
"origin_num"
:
314
},
{
"摆动排序 II"
:
{
...
...
@@ -1082,7 +1230,19 @@
"摆动排序 II"
],
"children"
:
[]
}
},
"origin_num"
:
323
},
{
"区间和的个数"
:
{
"node_id"
:
"algorithm-56f49e9431934f4ab2e3b09586675d3c"
,
"keywords"
:
[
"leetcode"
,
"区间和的个数"
],
"children"
:
[]
},
"origin_num"
:
326
},
{
"前 K 个高频元素"
:
{
...
...
@@ -1092,7 +1252,8 @@
"前 K 个高频元素"
],
"children"
:
[]
}
},
"origin_num"
:
346
},
{
"俄罗斯套娃信封问题"
:
{
...
...
@@ -1102,7 +1263,8 @@
"俄罗斯套娃信封问题"
],
"children"
:
[]
}
},
"origin_num"
:
353
},
{
"有序矩阵中第 K 小的元素"
:
{
...
...
@@ -1112,7 +1274,30 @@
"有序矩阵中第 K 小的元素"
],
"children"
:
[]
}
},
"origin_num"
:
377
},
{
"翻转对"
:
{
"node_id"
:
"algorithm-3a4e0f87183b4a27b08de2624304ca54"
,
"keywords"
:
[
"leetcode"
,
"翻转对"
],
"children"
:
[]
},
"origin_num"
:
492
},
{
"排序数组"
:
{
"node_id"
:
"algorithm-1b8fb429d0f242cb991e78bb19cfda1f"
,
"keywords"
:
[
"leetcode"
,
"排序数组"
],
"children"
:
[]
},
"origin_num"
:
911
}
]
}
...
...
@@ -1130,7 +1315,8 @@
"盛最多水的容器"
],
"children"
:
[]
}
},
"origin_num"
:
10
},
{
"最接近的三数之和"
:
{
...
...
@@ -1140,7 +1326,8 @@
"最接近的三数之和"
],
"children"
:
[]
}
},
"origin_num"
:
15
},
{
"删除有序数组中的重复项"
:
{
...
...
@@ -1150,7 +1337,8 @@
"删除有序数组中的重复项"
],
"children"
:
[]
}
},
"origin_num"
:
25
},
{
"移除元素"
:
{
...
...
@@ -1160,7 +1348,8 @@
"移除元素"
],
"children"
:
[]
}
},
"origin_num"
:
26
},
{
"下一个排列"
:
{
...
...
@@ -1170,7 +1359,8 @@
"下一个排列"
],
"children"
:
[]
}
},
"origin_num"
:
30
},
{
"旋转链表"
:
{
...
...
@@ -1180,7 +1370,8 @@
"旋转链表"
],
"children"
:
[]
}
},
"origin_num"
:
60
},
{
"颜色分类"
:
{
...
...
@@ -1190,7 +1381,8 @@
"颜色分类"
],
"children"
:
[]
}
},
"origin_num"
:
74
},
{
"合并两个有序数组"
:
{
...
...
@@ -1200,7 +1392,30 @@
"合并两个有序数组"
],
"children"
:
[]
}
},
"origin_num"
:
87
},
{
"环形链表"
:
{
"node_id"
:
"algorithm-b36465af5596480baf353689bbb76872"
,
"keywords"
:
[
"leetcode"
,
"环形链表"
],
"children"
:
[]
},
"origin_num"
:
140
},
{
"环形链表 II"
:
{
"node_id"
:
"algorithm-dc2fe764852f445ea4f7393548a21e83"
,
"keywords"
:
[
"leetcode"
,
"环形链表 II"
],
"children"
:
[]
},
"origin_num"
:
141
}
]
}
...
...
@@ -1226,7 +1441,8 @@
"二叉树的中序遍历"
],
"children"
:
[]
}
},
"origin_num"
:
93
},
{
"不同的二叉搜索树 II"
:
{
...
...
@@ -1236,7 +1452,8 @@
"不同的二叉搜索树 II"
],
"children"
:
[]
}
},
"origin_num"
:
94
},
{
"不同的二叉搜索树"
:
{
...
...
@@ -1246,7 +1463,8 @@
"不同的二叉搜索树"
],
"children"
:
[]
}
},
"origin_num"
:
95
},
{
"验证二叉搜索树"
:
{
...
...
@@ -1256,7 +1474,8 @@
"验证二叉搜索树"
],
"children"
:
[]
}
},
"origin_num"
:
97
},
{
"恢复二叉搜索树"
:
{
...
...
@@ -1266,7 +1485,8 @@
"恢复二叉搜索树"
],
"children"
:
[]
}
},
"origin_num"
:
98
},
{
"相同的树"
:
{
...
...
@@ -1276,7 +1496,8 @@
"相同的树"
],
"children"
:
[]
}
},
"origin_num"
:
99
},
{
"二叉树中的最大路径和"
:
{
...
...
@@ -1286,7 +1507,8 @@
"二叉树中的最大路径和"
],
"children"
:
[]
}
},
"origin_num"
:
123
}
]
}
...
...
@@ -1304,7 +1526,8 @@
"串联所有单词的子串"
],
"children"
:
[]
}
},
"origin_num"
:
29
},
{
"有效的数独"
:
{
...
...
@@ -1314,7 +1537,8 @@
"有效的数独"
],
"children"
:
[]
}
},
"origin_num"
:
35
},
{
"缺失的第一个正数"
:
{
...
...
@@ -1324,7 +1548,8 @@
"缺失的第一个正数"
],
"children"
:
[]
}
},
"origin_num"
:
40
},
{
"字母异位词分组"
:
{
...
...
@@ -1334,7 +1559,8 @@
"字母异位词分组"
],
"children"
:
[]
}
},
"origin_num"
:
48
},
{
"最小覆盖子串"
:
{
...
...
@@ -1344,7 +1570,8 @@
"最小覆盖子串"
],
"children"
:
[]
}
},
"origin_num"
:
75
},
{
"同构字符串"
:
{
...
...
@@ -1354,7 +1581,8 @@
"同构字符串"
],
"children"
:
[]
}
},
"origin_num"
:
204
}
]
}
...
...
@@ -1372,7 +1600,8 @@
"组合"
],
"children"
:
[]
}
},
"origin_num"
:
76
},
{
"单词搜索"
:
{
...
...
@@ -1382,7 +1611,8 @@
"单词搜索"
],
"children"
:
[]
}
},
"origin_num"
:
78
},
{
"克隆图"
:
{
...
...
@@ -1392,7 +1622,8 @@
"克隆图"
],
"children"
:
[]
}
},
"origin_num"
:
132
},
{
"课程表"
:
{
...
...
@@ -1402,7 +1633,8 @@
"课程表"
],
"children"
:
[]
}
},
"origin_num"
:
206
},
{
"课程表 II"
:
{
...
...
@@ -1412,7 +1644,8 @@
"课程表 II"
],
"children"
:
[]
}
},
"origin_num"
:
209
},
{
"矩阵中的最长递增路径"
:
{
...
...
@@ -1422,7 +1655,8 @@
"矩阵中的最长递增路径"
],
"children"
:
[]
}
},
"origin_num"
:
328
},
{
"重新安排行程"
:
{
...
...
@@ -1432,7 +1666,8 @@
"重新安排行程"
],
"children"
:
[]
}
},
"origin_num"
:
331
}
]
}
...
...
@@ -1450,7 +1685,8 @@
"整数反转"
],
"children"
:
[]
}
},
"origin_num"
:
6
},
{
"回文数"
:
{
...
...
@@ -1460,7 +1696,8 @@
"回文数"
],
"children"
:
[]
}
},
"origin_num"
:
8
},
{
"整数转罗马数字"
:
{
...
...
@@ -1470,7 +1707,8 @@
"整数转罗马数字"
],
"children"
:
[]
}
},
"origin_num"
:
11
},
{
"罗马数字转整数"
:
{
...
...
@@ -1480,7 +1718,8 @@
"罗马数字转整数"
],
"children"
:
[]
}
},
"origin_num"
:
12
},
{
"两数相除"
:
{
...
...
@@ -1490,7 +1729,8 @@
"两数相除"
],
"children"
:
[]
}
},
"origin_num"
:
28
},
{
"Pow(x, n)"
:
{
...
...
@@ -1500,7 +1740,8 @@
"Pow(x, n)"
],
"children"
:
[]
}
},
"origin_num"
:
49
},
{
"排列序列"
:
{
...
...
@@ -1510,7 +1751,8 @@
"排列序列"
],
"children"
:
[]
}
},
"origin_num"
:
59
},
{
"加一"
:
{
...
...
@@ -1520,7 +1762,8 @@
"加一"
],
"children"
:
[]
}
},
"origin_num"
:
65
},
{
"二进制求和"
:
{
...
...
@@ -1530,7 +1773,8 @@
"二进制求和"
],
"children"
:
[]
}
},
"origin_num"
:
66
},
{
"x 的平方根"
:
{
...
...
@@ -1540,7 +1784,8 @@
"x 的平方根"
],
"children"
:
[]
}
},
"origin_num"
:
68
}
]
}
...
...
@@ -1558,7 +1803,8 @@
"LRU 缓存机制"
],
"children"
:
[]
}
},
"origin_num"
:
145
},
{
"设计推特"
:
{
...
...
@@ -1568,7 +1814,8 @@
"设计推特"
],
"children"
:
[]
}
},
"origin_num"
:
354
},
{
"O(1) 时间插入、删除和获取随机元素"
:
{
...
...
@@ -1578,7 +1825,8 @@
"O(1) 时间插入、删除和获取随机元素"
],
"children"
:
[]
}
},
"origin_num"
:
379
},
{
"O(1) 时间插入、删除和获取随机元素 - 允许重复"
:
{
...
...
@@ -1588,7 +1836,8 @@
"O(1) 时间插入、删除和获取随机元素 - 允许重复"
],
"children"
:
[]
}
},
"origin_num"
:
380
},
{
"LFU 缓存"
:
{
...
...
@@ -1598,7 +1847,8 @@
"LFU 缓存"
],
"children"
:
[]
}
},
"origin_num"
:
459
}
]
}
...
...
@@ -1616,7 +1866,8 @@
"最长回文子串"
],
"children"
:
[]
}
},
"origin_num"
:
4
},
{
"正则表达式匹配"
:
{
...
...
@@ -1626,7 +1877,8 @@
"正则表达式匹配"
],
"children"
:
[]
}
},
"origin_num"
:
9
},
{
"括号生成"
:
{
...
...
@@ -1636,7 +1888,8 @@
"括号生成"
],
"children"
:
[]
}
},
"origin_num"
:
21
},
{
"通配符匹配"
:
{
...
...
@@ -1646,7 +1899,8 @@
"通配符匹配"
],
"children"
:
[]
}
},
"origin_num"
:
43
},
{
"最大子序和"
:
{
...
...
@@ -1656,7 +1910,8 @@
"最大子序和"
],
"children"
:
[]
}
},
"origin_num"
:
52
},
{
"不同路径"
:
{
...
...
@@ -1666,7 +1921,8 @@
"不同路径"
],
"children"
:
[]
}
},
"origin_num"
:
61
},
{
"不同路径 II"
:
{
...
...
@@ -1676,7 +1932,8 @@
"不同路径 II"
],
"children"
:
[]
}
},
"origin_num"
:
62
},
{
"最小路径和"
:
{
...
...
@@ -1686,7 +1943,8 @@
"最小路径和"
],
"children"
:
[]
}
},
"origin_num"
:
63
},
{
"爬楼梯"
:
{
...
...
@@ -1696,7 +1954,8 @@
"爬楼梯"
],
"children"
:
[]
}
},
"origin_num"
:
69
},
{
"编辑距离"
:
{
...
...
@@ -1706,7 +1965,8 @@
"编辑距离"
],
"children"
:
[]
}
},
"origin_num"
:
71
},
{
"最大矩形"
:
{
...
...
@@ -1716,7 +1976,8 @@
"最大矩形"
],
"children"
:
[]
}
},
"origin_num"
:
84
},
{
"扰乱字符串"
:
{
...
...
@@ -1726,7 +1987,8 @@
"扰乱字符串"
],
"children"
:
[]
}
},
"origin_num"
:
86
},
{
"解码方法"
:
{
...
...
@@ -1736,7 +1998,8 @@
"解码方法"
],
"children"
:
[]
}
},
"origin_num"
:
90
}
]
}
...
...
@@ -1754,7 +2017,8 @@
"电话号码的字母组合"
],
"children"
:
[]
}
},
"origin_num"
:
16
},
{
"解数独"
:
{
...
...
@@ -1764,7 +2028,8 @@
"解数独"
],
"children"
:
[]
}
},
"origin_num"
:
36
},
{
"组合总和"
:
{
...
...
@@ -1774,7 +2039,8 @@
"组合总和"
],
"children"
:
[]
}
},
"origin_num"
:
38
},
{
"组合总和 II"
:
{
...
...
@@ -1784,7 +2050,8 @@
"组合总和 II"
],
"children"
:
[]
}
},
"origin_num"
:
39
},
{
"全排列"
:
{
...
...
@@ -1794,7 +2061,8 @@
"全排列"
],
"children"
:
[]
}
},
"origin_num"
:
45
},
{
"全排列 II"
:
{
...
...
@@ -1804,7 +2072,8 @@
"全排列 II"
],
"children"
:
[]
}
},
"origin_num"
:
46
},
{
"N 皇后"
:
{
...
...
@@ -1814,7 +2083,8 @@
"N 皇后"
],
"children"
:
[]
}
},
"origin_num"
:
50
},
{
"N皇后 II"
:
{
...
...
@@ -1824,7 +2094,8 @@
"N皇后 II"
],
"children"
:
[]
}
},
"origin_num"
:
51
},
{
"格雷编码"
:
{
...
...
@@ -1834,7 +2105,8 @@
"格雷编码"
],
"children"
:
[]
}
},
"origin_num"
:
88
},
{
"子集 II"
:
{
...
...
@@ -1844,7 +2116,8 @@
"子集 II"
],
"children"
:
[]
}
},
"origin_num"
:
89
}
]
}
...
...
@@ -1862,7 +2135,8 @@
"跳跃游戏 II"
],
"children"
:
[]
}
},
"origin_num"
:
44
},
{
"跳跃游戏"
:
{
...
...
@@ -1872,7 +2146,8 @@
"跳跃游戏"
],
"children"
:
[]
}
},
"origin_num"
:
54
},
{
"文本左右对齐"
:
{
...
...
@@ -1882,7 +2157,8 @@
"文本左右对齐"
],
"children"
:
[]
}
},
"origin_num"
:
67
},
{
"买卖股票的最佳时机 II"
:
{
...
...
@@ -1892,7 +2168,8 @@
"买卖股票的最佳时机 II"
],
"children"
:
[]
}
},
"origin_num"
:
121
},
{
"加油站"
:
{
...
...
@@ -1902,7 +2179,8 @@
"加油站"
],
"children"
:
[]
}
},
"origin_num"
:
133
},
{
"分发糖果"
:
{
...
...
@@ -1912,7 +2190,8 @@
"分发糖果"
],
"children"
:
[]
}
},
"origin_num"
:
134
}
]
}
...
...
src/tree.py
浏览文件 @
a31cdcee
...
...
@@ -14,6 +14,7 @@ formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
handler
.
setFormatter
(
formatter
)
logger
.
addHandler
(
handler
)
def
load_json
(
p
):
with
open
(
p
,
'r'
)
as
f
:
return
json
.
loads
(
f
.
read
())
...
...
@@ -50,6 +51,8 @@ def parse_no_name(d):
no
=
int
(
m
.
group
(
1
))
dir_name
=
m
.
group
(
2
)
except
:
logger
.
error
(
'parser no name failed'
)
logger
.
error
(
d
)
sys
.
exit
(
0
)
return
no
,
dir_name
...
...
@@ -99,13 +102,17 @@ class TreeWalker:
for
index
,
chapter
in
enumerate
(
level_node
[
"children"
]):
chapter_title
=
list
(
chapter
.
keys
())[
0
]
chapter_node
=
list
(
chapter
.
values
())[
0
]
chapter_path
=
os
.
path
.
join
(
level_path
,
f
"
{
index
+
1
}
.
{
chapter_title
}
"
)
chapter_path
=
os
.
path
.
join
(
level_path
,
f
"
{
index
+
1
}
.
{
chapter_title
}
"
)
self
.
load_sections
(
chapter_path
,
chapter_node
)
for
index
,
section_node
in
enumerate
(
chapter_node
[
"children"
]):
section_title
=
list
(
section_node
.
keys
())[
0
]
full_path
=
os
.
path
.
join
(
chapter_path
,
f
"
{
index
}
.
{
section_title
}
"
)
full_path
=
os
.
path
.
join
(
chapter_path
,
f
"
{
section_node
[
'origin_num'
]
}
.
{
section_title
}
"
)
if
os
.
path
.
isdir
(
full_path
):
self
.
ensure_exercises
(
full_path
)
else
:
pass
tree_path
=
os
.
path
.
join
(
self
.
root
,
"tree.json"
)
dump_json
(
tree_path
,
self
.
tree
,
exist_ok
=
True
,
override
=
True
)
...
...
@@ -158,6 +165,8 @@ class TreeWalker:
sections
.
append
((
num
,
section
))
sections
.
sort
(
key
=
lambda
item
:
item
[
0
])
for
item
in
sections
:
item
[
1
][
'origin_num'
]
=
item
[
0
]
chapter_node
[
"children"
]
=
[
item
[
1
]
for
item
in
sections
]
return
chapter_node
...
...
@@ -217,8 +226,8 @@ class TreeWalker:
config
=
{
"node_id"
:
self
.
gen_node_id
(),
"keywords"
:
[],
"children"
:[],
"export"
:[]
"children"
:
[],
"export"
:
[]
}
dump_json
(
config_path
,
config
,
exist_ok
=
True
,
override
=
True
)
else
:
...
...
@@ -241,7 +250,7 @@ class TreeWalker:
def
extract_node_env
(
self
,
path
):
try
:
_
,
dir
=
os
.
path
.
split
(
path
)
self
.
logger
.
info
(
path
)
#
self.logger.info(path)
number
,
title
=
dir
.
split
(
"."
,
1
)
return
int
(
number
),
title
except
Exception
as
error
:
...
...
@@ -281,5 +290,4 @@ class TreeWalker:
exercise
=
load_json
(
full_name
)
if
"exercise_id"
not
in
exercise
:
exercise
[
"exercise_id"
]
=
uuid
.
uuid4
().
hex
dump_json
(
full_name
,
exercise
)
dump_json
(
full_name
,
exercise
,
True
,
True
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录