Skip to content

Commit 750ffa6

Browse files
author
lucifer
committed
fix: #2
1 parent c6d3816 commit 750ffa6

File tree

4 files changed

+14
-33
lines changed

4 files changed

+14
-33
lines changed

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"test": "react-scripts test",
2424
"eject": "react-scripts eject",
2525
"crawl": "node scripts/curlLeetcode.js && node scripts/generateLeetcode.js",
26-
"clean": "rm -f src/db/root.db.js"
26+
"clean": "rm -f src/db/root.db.js && rm -rf spider/"
2727
},
2828
"browserslist": {
2929
"production": [

‎public/logo.png

14.5 KB
Loading

‎src/App.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,11 @@ function App() {
129129
</a>
130130
</Fragment>
131131
)}
132-
{problems[problemId].keyPoints.map(({ id, link, text, color }) => (
133-
<TagOrLink
134-
key={text}
135-
text={text}
136-
link={link}
137-
color={color}
138-
style={{ marginBottom: 6 }}
139-
/>
140-
))}
132+
<ul>
133+
{problems[problemId].keyPoints.map(({ id, link, text }) => (
134+
<li key={id}>{link ? <a href={link}>text</a> : text}</li>
135+
))}
136+
</ul>
141137
</TabPane>
142138
<TabPane tab="公司" key="4">
143139
{problems[problemId].companies.length === 0 && (

‎src/db/root.db.js

+8-23
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@
166166
}
167167
]
168168
},
169-
"median-of-two-sorted-array":{
169+
"median-of-two-sorted-arrays":{
170170
"id": "4",
171-
"name": "median-of-two-sorted-array",
171+
"name": "median-of-two-sorted-arrays",
172172
"pre": [
173173
{
174174
"text": "中位数",
@@ -219,8 +219,8 @@
219219
"name": "腾讯"
220220
}
221221
],
222-
"giteeSolution": "https://gitee.com/golong/leetcode/blob/master/problems/4.median-of-two-sorted-array.md",
223-
"solution": "https://github.com/azl397985856/leetcode/blob/master/problems/4.median-of-two-sorted-array.md",
222+
"giteeSolution": "https://gitee.com/golong/leetcode/blob/master/problems/4.median-of-two-sorted-arrays.md",
223+
"solution": "https://github.com/azl397985856/leetcode/blob/master/problems/4.median-of-two-sorted-arrays.md",
224224
"code": [
225225
{
226226
"language": "java",
@@ -333,9 +333,9 @@
333333
}
334334
]
335335
},
336-
"3-sum":{
336+
"3sum":{
337337
"id": "15",
338-
"name": "3-sum",
338+
"name": "3sum",
339339
"pre": [
340340
{
341341
"text": "排序",
@@ -373,8 +373,8 @@
373373
"name": "字节跳动"
374374
}
375375
],
376-
"giteeSolution": "https://gitee.com/golong/leetcode/blob/master/problems/15.3-sum.md",
377-
"solution": "https://github.com/azl397985856/leetcode/blob/master/problems/15.3-sum.md",
376+
"giteeSolution": "https://gitee.com/golong/leetcode/blob/master/problems/15.3sum.md",
377+
"solution": "https://github.com/azl397985856/leetcode/blob/master/problems/15.3sum.md",
378378
"code": [
379379
{
380380
"language": "js",
@@ -7071,21 +7071,6 @@
70717071
}
70727072
]
70737073
},
7074-
"Find-Mode-in-Binary-Search-Tree":{
7075-
"id": "501",
7076-
"name": "Find-Mode-in-Binary-Search-Tree",
7077-
"pre": [],
7078-
"keyPoints": [],
7079-
"companies": [],
7080-
"giteeSolution": "https://gitee.com/golong/leetcode/blob/master/problems/501.Find-Mode-in-Binary-Search-Tree.md",
7081-
"solution": "https://github.com/azl397985856/leetcode/blob/master/problems/501.Find-Mode-in-Binary-Search-Tree.md",
7082-
"code": [
7083-
{
7084-
"language": "java",
7085-
"text": "\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n * int val;\n * TreeNode left;\n * TreeNode right;\n * TreeNode(int x) { val = x; }\n * }\n */\nclass Solution { \n List<Integer> list = new ArrayList<> ();\n TreeNode preNode = null;\n int max = 0, count = 0;\n \n public int[] findMode(TreeNode root) {\n helper(root);\n int[] res = new int[list.size()];\n for (int i=0; i<res.length; i++) {\n res[i] = list.get(i);\n }\n return res;\n }\n \n private void helper (TreeNode root) {\n if (root == null) return;\n helper(root.left);\n \n if (preNode != null && root.val == preNode.val) {\n count++;\n } else {\n count = 1;\n }\n \n if (count > max) {\n list.clear();\n list.add(root.val);\n max = count;\n } else if (max == count) {\n list.add(root.val); \n }\n preNode = root;\n helper(root.right);\n }\n}\n"
7086-
}
7087-
]
7088-
},
70897074
"longest-palindromic-subsequence":{
70907075
"id": "516",
70917076
"name": "longest-palindromic-subsequence",

0 commit comments

Comments
 (0)