Python in Action.
Only unique questions from LintCode are included. Duplicated questions of LeetCode are excluded, which can be found in https://github.com/idf/LeetCode instead.
This repo mainly uses Python. To run in Python:
python <QuestionName>.py
If you encountered Class Already Defined
compilation problem in OJ, please remove TreeNode
, GraphNode
or etc.
Some algorithms in Python cannot pass the OJ due to OJ bugs; thus the alternative solutions in java in the exactly same algorithm are provided. To run in Java:
cd LintCode/java/src/main/java
javac <PackageName>/Solution.java
java -ea <PackageName>/Solution # -ea: enable assertion
Failed attempts are kept in the source code as documentation, which are annotated as TLE (Time Limit Exceeds) or MLE (Memory Limit Exceeds).
Most of the code are from the section tag of LintCode Copyright