pyleetcode-utils

Python Leetcode utilities


License
MIT
Install
pip install pyleetcode-utils==0.1.3

Documentation

pyleetcode-utils

Latest Version Build Status codecov Python Version wemake-python-styleguide license

Features

Currently, only LeetCode TreeNode implemented.

  • Converting [5, 3, 6, 2, 4, null, 7] -> TreeNode(5, TreeNode(3,...), TreeNode(6,...))

Installation

pip install pyleetcode-utils

Example

TreeNode usage:

from pyleetcode_utils import null
from pyleetcode_utils.datatypes import tree


class Solution:
  @tree.make_tree
  def findTarget(self, root: tree.TreeNode, k: int) -> bool:
    ...


Solution().findTarget([5, 3, 6, 2, 4, null, 7], 9)