leetcodeutils
Introduction
Some useful utilities for coding with Leetcode in PyCharm.
Support features:
- Directly debugging and get output in PyCharm with Leetcode problems by using the most simple codes. (tips: implemented by reflection and support the most problems in Leetcode)
- Coming soon.
Usage
- Install the latest version by pip under python3:
pip install leetcodeutils
- In your
main.py
,- Instantiate a case wrapper of
CaseWrapper
with initial arguments of directly test case in Leetcode problem like"babad"
, just copy-paste what case you saw in Leetcode problem. - Instantiate a case executor of
CaseExecutor
with initial arguments of target class likeSolution
, target method string like"addTwoNumbers"
for Leetcode No.2 problem, former case wrapper. - Invoke the method
execute
of case executor instance, the Leetcode's style output will be returned.
- Instantiate a case wrapper of
For more detailed usage, just see SimpleExample.py, TreeNodeExample.py, ListNodeExample.py, ComplexExample.py
License
leetcodeutils is MIT licensed, as found in the LICENSE file.
Other
Maintained by Gancheng Yuan
Having fun in Leetcode. ^ v ^