Skip to content

EternalHeartTeam/LeetcodePracticeTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Leetcode Practice Template

A template project for using LeetCode practice.

Usage

1. First Step - Install Dependencies

The only dependency is leetcode-practice.

# Install dependencies with npm
npm i 

# Or with yarn
yarn

2. Second Step - Run with npm

After installing dependencies, run the command npm run lc to create today's question.

# Create today's question
npm run lc 

You will see the console output, and the question will be created in the src directory.

yarn run v1.22.19
$ lc -d src
MODE: today
้ข˜็›ฎ[2235.ๅฐ†ๆ ‡้ข˜้ฆ–ๅญ—ๆฏๅคงๅ†™]่Žทๅ–ๆˆๅŠŸ!
้ข˜็›ฎๆ–‡ไปถๅœฐๅ€ไธบ:file:///Users/mac-106/wh131462/workspace/LeetcodePracticeTemplate/src/2235.capitalize-the-title/question.js:35
โœจ  Done in 2.96s.

3. Third Step - Check Your Solution

To check your solution, run the command npm run lk.

# Check solution
npm run lk

You will see the results (the example shows an empty code):

yarn run v1.22.19
$ lk -d src
MODE: today
้ข˜็›ฎ[2235.ๅฐ†ๆ ‡้ข˜้ฆ–ๅญ—ๆฏๅคงๅ†™]ๆฃ€ๆต‹็ป“ๆžœ:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๆต‹่ฏ•็ป“ๆžœ  โ”‚                 ้ข„ๆœŸ็ป“ๆžœ                 โ”‚                 ๆ‰ง่กŒ็ป“ๆžœ                 โ”‚  ๆ‰ง่กŒ็”จๆ—ถ  โ”‚  ๅ†…ๅญ˜ๅ ็”จ  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚   ๆœช้€š่ฟ‡   โ”‚          "Capitalize The Title"          โ”‚                                          โ”‚  0.5894ms  โ”‚  2.42 KB   โ”‚
โ”‚   ๆœช้€š่ฟ‡   โ”‚       "First Letter of Each Word"        โ”‚                                          โ”‚  0.0182ms  โ”‚  2.56 KB   โ”‚
โ”‚   ๆœช้€š่ฟ‡   โ”‚            "i Love Leetcode"             โ”‚                                          โ”‚  0.0087ms  โ”‚  2.56 KB   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
็‚นๅ‡ป่ทณ่ฝฌๅˆฐ้ข˜็›ฎๆไบค: https://leetcode.cn/problems/capitalize-the-title/
โœจ  Done in 0.36s.

4. Fourth Step - Search

To search for a question, use lf.

# Search for a question
npm run lf

Follow the prompts to search for what you want.

# For example, searching for the two number sum question
yarn run v1.22.19
$ lf -d src
? ่ฏท้€‰ๆ‹ฉๆŸฅๆ‰พ็š„ๆจกๅผ? ๅ…ณ้”ฎ่ฏๆœ็ดข
? ่ฏท่พ“ๅ…ฅๅ…ณ้”ฎ่ฏ two number sum
? ่ฏท้€‰ๆ‹ฉ้ข˜็›ฎ 1.ไธคๆ•ฐไน‹ๅ’Œ
1
MODE: identity
้ข˜็›ฎ[1.ไธคๆ•ฐไน‹ๅ’Œ]่Žทๅ–ๆˆๅŠŸ!
้ข˜็›ฎๆ–‡ไปถๅœฐๅ€ไธบ:file:///Users/mac-106/wh131462/workspace/LeetcodePracticeTemplate/src/1.two-sum/question.js:30
โœจ  Done in 13.68s.

More Information

For more information about leetcode-practice, please check the GitHub repository: leetcode-practice

About

A template project to use leetcode-practice......

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published