Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leetcode_local_runner-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leetcode_local_runner-0.0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file leetcode_local_runner-0.0.1.tar.gz.

File metadata

  • Download URL: leetcode_local_runner-0.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for leetcode_local_runner-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2a925063d1dc62237c3b8089377089e9d283d17b4db5dd75db3185abfbd1a697
MD5 3bf7383db8f9e8b87b16f4031362de17
BLAKE2b-256 be0c8a207ab5abf2269e8b2fbe4f3d3b8ae2ff15ba512bad58d0957258cf0fa2

See more details on using hashes here.

Provenance

The following attestation bundles were made for leetcode_local_runner-0.0.1.tar.gz:

Publisher: publish.yml on shenoy-anurag/leetcode-runner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leetcode_local_runner-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for leetcode_local_runner-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d1e84cb0d34adf2737754309c029367a5f1be288bf452ecc01d630e7a3c7e4e
MD5 9179ad356b3cf56d2df80399ea9996a4
BLAKE2b-256 4404ccf003239e91b202316ef211372e1765eca362c426525dd8e0b2fd779ae8

See more details on using hashes here.

Provenance

The following attestation bundles were made for leetcode_local_runner-0.0.1-py3-none-any.whl:

Publisher: publish.yml on shenoy-anurag/leetcode-runner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page