Skip to content

Commit a22497e

Browse files
author
Openset
committed
Add: description
1 parent 306c313 commit a22497e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

internal/description/description.go

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package description
2+
3+
import (
4+
"github.com/openset/leetcode/internal/base"
5+
"github.com/openset/leetcode/internal/leetcode"
6+
)
7+
8+
var CmdDescription = &base.Command{
9+
Run: runDescription,
10+
UsageLine: "description",
11+
Short: "build all problems description file",
12+
Long: "build all problems README.md file.",
13+
}
14+
15+
func runDescription(cmd *base.Command, args []string) {
16+
if len(args) != 0 {
17+
cmd.Usage()
18+
}
19+
problems := leetcode.ProblemsAll()
20+
for _, problem := range problems.StatStatusPairs {
21+
titleSlug := problem.Stat.QuestionTitleSlug
22+
leetcode.QuestionData(titleSlug).Data.Question.SaveContent()
23+
}
24+
}

0 commit comments

Comments
 (0)