Skip to content

A powerful practice platform for leetcode. Using any way you want to create questions.

License

Notifications You must be signed in to change notification settings

EternalHeartTeam/leetcode-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode practice

力扣练习库!开始你的每日一题! 在编辑器中编写你的代码,简单有效的执行和计时!

TO-DO List

  • 1.模板:获取js的函数体并替换生成文件中的@function
  • 2.模板:从detail中获取输入用例的数据填充@Testcase
  • 3.模板:获取跳转每日一题的链接替换@url
  • 4.函数:优化时间和资源统计函数

How to use for yourself ?

fork分支template的内容,其非内容部分会与主分支保持同步,意思是只是去除了题目代码,使用指令创建你自己的题解即可!

Preparation

只需要一个node环境即可.(如何安装node?点我了解)

node:lts

Usage

0. 安装依赖

yarn install # 或者任意你喜欢的包管理工具,如
pnpm install

1. 创建题目

# 可以使用你喜欢的任意包管理工具,例如 `pnpm`/`npm`
yarn leet-create [题目编号或者名称]

e.g.
yarn leet-create 1314

然后会在目录中创建一个模板js文件,目录结构为:

-src
└── src
  └── 1314
    └── index.js # 模板js文件 可以替换题目

2. 检验结果

# 可以使用你喜欢的任意包管理工具,例如 `pnpm`/`npm`
yarn leet-check [题目编号或者名称]

e.g.
yarn leet-check 1314

会出现其用时以及内存占用:

yarn run v1.22.19
$ node common/scripts/check.js 2696
执行结果:
5
函数执行用时: 2.509ms
内存占用:262144
2
函数执行用时: 0.063ms
内存占用:0

✨  Done in 0.13s.

Scripts API Document

script 参数 说明
leet-create 题目编号或者题目名称 创建一个模板文件
leet-check 题目编号或者题目名称 执行某个项目
get-question 获取今日题目对象
create-today 创建今日题目
check-today 检查今日题目

note: 名词解释: 题目编号或者题目名称(题目创建的时候的唯一标识,可以是题目的LeetCode编号也可以是自己起得别名)

Contributor

EternalHeart SmallTeddy

About

A powerful practice platform for leetcode. Using any way you want to create questions.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks