Skip to content

nickyfoto/lcpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lcpy

LeetCode CLI helper for python.

Features

  • Generate testing files for test locally using pytest.
  • Provide common algorithm and data structure modules for easy prototyping.

Modules

Algorithms

Data structures

  • instance method

    • update(i, val)
    • query(i, j)
  • instance method

    • update(i, val)
    • query(i)

TreeNode

  • build_root: return TreeNode instance from given list.

  • instance method

    • __str__: print tree in bfs (ignore None node).
    • pre: return pre order of DFS traversal
    • post: return post order of DFS traversal

ListNode (Linked List):

  • build_head: return ListNode instance from given list.
  • __str__: print linked list.
  • value_eq: value based equality check.

PriorityQueue

  • max heap pq

Graph

DiGraph

Installation

git clone https://github.com/nickyfoto/lcpy.git
pip3 install ./lcpy

Install in editable mode

pip3 install -e ./lcpy

Usage

generate module and test template

lcpy cp <some_file.py>

TODO

  • substring search, KMP
  • deal with cp file not exist
  • cannot cp design problem
  • Bit Manipulation
  • Concurrency
  • ShellSort
  • Red-Black BST, B-Tree
  • Convex Hull
  • Sparse Vectors
  • Max Flow
  • Redix Sorts
  • Regular Expression
  • name 'List' is not defined
  • cannot generate testing without adding pass.
  • add tree visualizer function
  • generate testing file for non class Solution problem.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages