Simple, minimal helper with setting up Leetcode practice in your comfy local dev env:
- Pandoc (we use this to handle html parsing + markdown output)
- Rust toolchain (we use this to compile)
To install, execute the following in project root:
cargo install --path .
To uninstall, execute the following in project root:
cargo uninstall
Check installation:
which grindset
Make sure you're in the correct directory, we currently don't have project root tracking!
grindset relies on leetcode question slugs, which you can reliably get from your browser's address bar:
grindset returns the path of the created attempt directory for piping and chaining.
So, if you use an in-terminal editor like Neovim , you can jump into your editor with a single command.
cd $(grindset two-sum py) && nvim $(find attempt.*)
Set up a shell alias for it, if you'd like!
grindset two-sum py
grindsetadds starter boilerplate for your language if available from Leetcode's API, but Leetcode's API does not necessarily provide fully valid boilerplate. Some examples:- Go boilerplate snippets would not include the requisite
package maindeclaration. - Python boilerplate might include type hints in function signatures that you would then need to import.
- Go boilerplate snippets would not include the requisite
- Be careful that you're running the command in the root of your project, as files get created at the current working directory.
- This might improve in a subsequent version, with the addition of a project root marker file (e.g.
grindset.toml).
- This might improve in a subsequent version, with the addition of a project root marker file (e.g.