Skip to content

Commit 7a6932f

Browse files
author
openset
committed
Add: IsSolved
1 parent ebaec13 commit 7a6932f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

internal/leetcode/problems_status.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
package leetcode
22

3-
var ProblemStatus = map[int]bool{
3+
// 状态
4+
func IsSolved(id int) bool {
5+
return problemStatus[id]
6+
}
7+
8+
var problemStatus = map[int]bool{
49
1: true,
510
2: true,
611
3: true,

internal/post/post.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func runPost(cmd *base.Command, args []string) {
8484
oldPath := filepath.Join(basePath, "leetcode", filename)
8585
newPath := filepath.Join(basePath, "_posts", filename)
8686
base.FilePutContents(oldPath, buf.Bytes())
87-
if leetcode.ProblemStatus[questionId] {
87+
if leetcode.IsSolved(questionId) {
8888
_ = os.Rename(oldPath, newPath)
8989
} else {
9090
_ = os.Remove(newPath)

0 commit comments

Comments
 (0)