Skip to main content

Overview

PyPI Version PyPI License

A python package with tools to let you try coding problems and check your code against your own test cases.

Sites like LeetCode and Project Euler have great problems you can solve to improve your data-structures and algorithm knowledge.

But LeetCode's IDE isn't fun to code in, and harder to debug in.

Project Euler has no web IDE at all.

This tool allows you to quickly start solving those problems and add test-cases quickly.

Installation

Install using pip:

$ pip install leetcode-local-runner

or with Poetry:

$ poetry add leetcode-local-runner

Usage

  1. Install the library.
  2. Pick a problem to solve from either LeetCode or Project Euler.
  3. Copy the code in the editor into a python file.
    class Solution:
     def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
         pass
    
  4. Create your own test-cases and pass them into the LeetCode class like so:
test_cases = [
    {"temperatures": [73, 74, 75, 71, 69, 72, 76, 73]},
    {"temperatures": [30, 40, 50, 60]},
    {"temperatures": [30, 60, 90]},
]
expected_outputs = [
    [1, 1, 4, 2, 1, 1, 0, 0],
    [1, 1, 1, 0],
    [1, 1, 0],
]

lc = LeetCode(test_cases=test_cases, expected_outputs=expected_outputs, fn=Solution().isSameTree)
lc.run_test_cases()

Run Test Cases Output

Requirements

  • Python >= 3.10

Metadata

Release files for leetcode-local-runner 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leetcode-local-runner 0.0.1
File Size Uploaded
leetcode_local_runner-0.0.1.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for leetcode-local-runner 0.0.1
File Interpreter ABI Platform
leetcode_local_runner-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / leetcode_local_runner-0.0.1.tar.gz

Download URL leetcode_local_runner-0.0.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2a925063d1dc62237c3b8089377089e9d283d17b4db5dd75db3185abfbd1a697
BLAKE2b-256 checksum
How to use checksums
be0c8a207ab5abf2269e8b2fbe4f3d3b8ae2ff15ba512bad58d0957258cf0fa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 3, 2025.

Transparency log

Release files / leetcode_local_runner-0.0.1-py3-none-any.whl

Download URL leetcode_local_runner-0.0.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d1e84cb0d34adf2737754309c029367a5f1be288bf452ecc01d630e7a3c7e4e
BLAKE2b-256 checksum
How to use checksums
4404ccf003239e91b202316ef211372e1765eca362c426525dd8e0b2fd779ae8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 3, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page