File tree 6 files changed +17
-8
lines changed
6 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 25
25
26
26
func graphQLRequest (filename string , days int , jsonStr string , v interface {}) {
27
27
data := remember (filename , days , func () []byte {
28
- return client .PostJson (graphqlUrl , jsonStr )
28
+ return client .PostJson (graphQL , jsonStr )
29
29
})
30
30
jsonDecode (data , & v )
31
31
}
Original file line number Diff line number Diff line change 8
8
apiProblemsShellUrl = "https://leetcode.com/api/problems/shell/"
9
9
problemsetAllUrl = "https://leetcode.com/problemset/all/"
10
10
questionArticleUrl = "https://leetcode.com/articles/%s/"
11
- graphqlUrl = "https://leetcode-cn.com/graphql"
11
+ graphQLUrl = "https://leetcode.com/graphql"
12
+ graphQLCnUrl = "https://leetcode-cn.com/graphql"
12
13
apiProgressAllUrl = "https://leetcode.com/api/progress/all/"
13
14
submissionsLatestUrl = "https://leetcode.com/submissions/latest/"
14
15
)
@@ -26,3 +27,5 @@ const (
26
27
questionArticleFile = "question_article_%s.html"
27
28
topicTagFile = "topic_tag_%s.json"
28
29
)
30
+
31
+ var graphQL = graphQLCnUrl
Original file line number Diff line number Diff line change @@ -28,10 +28,15 @@ func QuestionData(titleSlug string, isForce bool) (qd questionDataType) {
28
28
graphQLRequest (filename , days , jsonStr , & qd )
29
29
if qd .Data .Question .TitleSlug == "" {
30
30
_ = os .Remove (getCachePath (filename ))
31
+ if graphQL == graphQLCnUrl {
32
+ graphQL = graphQLUrl
33
+ return QuestionData (titleSlug , isForce )
34
+ }
31
35
for _ , err := range qd .Errors {
32
36
log .Println (titleSlug , err .Message )
33
37
}
34
38
}
39
+ graphQL = graphQLCnUrl
35
40
return
36
41
}
37
42
Original file line number Diff line number Diff line change 17
17
| 11 | [ Breadth-first Search] ( https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md ) | [ 广度优先搜索] ( https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md ) | | 12 | [ Stack] ( https://github.com/openset/leetcode/tree/master/tag/stack/README.md ) | [ 栈] ( https://github.com/openset/leetcode/tree/master/tag/stack/README.md ) |
18
18
| 13 | [ Backtracking] ( https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md ) | [ 回溯算法] ( https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md ) | | 14 | [ Design] ( https://github.com/openset/leetcode/tree/master/tag/design/README.md ) | [ 设计] ( https://github.com/openset/leetcode/tree/master/tag/design/README.md ) |
19
19
| 15 | [ Linked List] ( https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md ) | [ 链表] ( https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md ) | | 16 | [ Heap] ( https://github.com/openset/leetcode/tree/master/tag/heap/README.md ) | [ 堆] ( https://github.com/openset/leetcode/tree/master/tag/heap/README.md ) |
20
- | 17 | [ Bit Manipulation ] ( https://github.com/openset/leetcode/tree/master/tag/bit-manipulation /README.md ) | [ 位运算 ] ( https://github.com/openset/leetcode/tree/master/tag/bit-manipulation /README.md ) | | 18 | [ Sort ] ( https://github.com/openset/leetcode/tree/master/tag/sort /README.md ) | [ 排序 ] ( https://github.com/openset/leetcode/tree/master/tag/sort /README.md ) |
20
+ | 17 | [ Sort ] ( https://github.com/openset/leetcode/tree/master/tag/sort /README.md ) | [ 排序 ] ( https://github.com/openset/leetcode/tree/master/tag/sort /README.md ) | | 18 | [ Bit Manipulation ] ( https://github.com/openset/leetcode/tree/master/tag/bit-manipulation /README.md ) | [ 位运算 ] ( https://github.com/openset/leetcode/tree/master/tag/bit-manipulation /README.md ) |
21
21
| 19 | [ Graph] ( https://github.com/openset/leetcode/tree/master/tag/graph/README.md ) | [ 图] ( https://github.com/openset/leetcode/tree/master/tag/graph/README.md ) | | 20 | [ Union Find] ( https://github.com/openset/leetcode/tree/master/tag/union-find/README.md ) | [ 并查集] ( https://github.com/openset/leetcode/tree/master/tag/union-find/README.md ) |
22
22
| 21 | [ Divide and Conquer] ( https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md ) | [ 分治算法] ( https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md ) | | 22 | [ Trie] ( https://github.com/openset/leetcode/tree/master/tag/trie/README.md ) | [ 字典树] ( https://github.com/openset/leetcode/tree/master/tag/trie/README.md ) |
23
23
| 23 | [ Sliding Window] ( https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md ) | [ Sliding Window] ( https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md ) | | 24 | [ Recursion] ( https://github.com/openset/leetcode/tree/master/tag/recursion/README.md ) | [ 递归] ( https://github.com/openset/leetcode/tree/master/tag/recursion/README.md ) |
Original file line number Diff line number Diff line change 9
9
10
10
| # | 题名 | 标签 | 难度 |
11
11
| :-: | - | - | :-: |
12
+ | 1080 | [ 根到叶路径上的不足节点] ( https://github.com/openset/leetcode/tree/master/problems/insufficient-nodes-in-root-to-leaf-paths ) | [[ 深度优先搜索] ( https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md )] | Medium |
12
13
| 1061 | [ 按字典序排列最小的等效字符串] ( https://github.com/openset/leetcode/tree/master/problems/lexicographically-smallest-equivalent-string ) 🔒 | [[ 深度优先搜索] ( https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md )] [[ 并查集] ( https://github.com/openset/leetcode/tree/master/tag/union-find/README.md )] | Medium |
13
14
| 1034 | [ 边框着色] ( https://github.com/openset/leetcode/tree/master/problems/coloring-a-border ) | [[ 深度优先搜索] ( https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md )] | Medium |
14
15
| 1028 | [ 从先序遍历还原二叉树] ( https://github.com/openset/leetcode/tree/master/problems/recover-a-tree-from-preorder-traversal ) | [[ 树] ( https://github.com/openset/leetcode/tree/master/tag/tree/README.md )] [[ 深度优先搜索] ( https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md )] | Hard |
Original file line number Diff line number Diff line change 79
79
"Slug" : " heap" ,
80
80
"TranslatedName" : " 堆"
81
81
},
82
- {
83
- "Name" : " Bit Manipulation" ,
84
- "Slug" : " bit-manipulation" ,
85
- "TranslatedName" : " 位运算"
86
- },
87
82
{
88
83
"Name" : " Sort" ,
89
84
"Slug" : " sort" ,
90
85
"TranslatedName" : " 排序"
91
86
},
87
+ {
88
+ "Name" : " Bit Manipulation" ,
89
+ "Slug" : " bit-manipulation" ,
90
+ "TranslatedName" : " 位运算"
91
+ },
92
92
{
93
93
"Name" : " Graph" ,
94
94
"Slug" : " graph" ,
You can’t perform that action at this time.
0 commit comments