leetr

Crates.ioleetr
lib.rsleetr
version0.1.3
sourcesrc
created_at2024-05-28 13:35:46.50988
updated_at2024-05-29 21:49:57.169424
descriptionA CLI tool for setting up local LeetCode projects
homepage
repositoryhttps://github.com/pophilpo/leetr
max_upload_size
id1254395
size241,507
Popov Philipp (pophilpo)

documentation

README

Leetr

A CLI tool for setting up local LeetCode projects.

Installation

Using cargo

cargo install leetr

From source

# Clone the repository
git clone https://github.com/pophilpo/leetr

# Navigate into the project directory
cd leetr

# Build the project in release mode
cargo build --release

# Copy the binary to your bin directory (adjust the path if necessary)
sudo cp target/release/leetr /usr/local/bin

Usage

To use leetr, pass the URL of the LeetCode problem or it's title and the language of your choice (python/rust) to the tool.

Arguments

  • -d, --dir Create a directory with custom name for the problem, otherwise uses problem name
  • -l, --lang Programming language used to setup the project [default: rust]
  • -h, --help Print help

This command generates a Python 3 project with the following structure:

  • A two_sum/README.md file describing the problem.
  • A two_sum/main.py file containing the initial problem code
leetr https://leetcode.com/problems/two-sum/description -l python

This command generates a Rust project with custom name and the following structure:

  • A my_project/README.md file describing the problem.
  • A my_project/main.rs file containing the initial problem code
leetr two-sum -l rust -d my_project

Supported languages

  • Rust
  • Python 3
  • Python
  • C++
  • Java
  • C
  • C#
  • JavaScript
  • TypeScript
  • PHP
  • Swift
  • Kotlin
  • Dart
  • Go
  • Ruby
  • Scala
  • Racket
  • Erlang
  • Elixir
Commit count: 64

cargo fmt