add2Readme.py
can:
- Add folder for each question, and generate
Python
file,readme.md
file and.gitignore
file with the new folder - Add links to
readme.md
The using method is:
python add2Readme.py --name "Container With Most Water" -i 11 -d medium -t array
update_ideas.py
can search for comments of each python file and add that
to basic ideas, which requires the comment musk be a short introduction of
the answer.
This repository focuses on solving all Leetcode problems with Python. The layout has two factors, which are tags and difficulty. Besides, there will be explanation for each question.
# | Title | Explanation | Code | Basic Ideas |
---|---|---|---|---|
1 | Two Sum | Answer | Python | 1. Hash Table 2. One-Pass Hash Table |
26 | Remove Duplicates from Sorted Array | Answer | Python | 1. Two Pointers |
27 | Remove Element | Answer | Python | 1. Two Pointers |
35 | Search Insert Position | Answer | Python | 1. Binary Search 2. Improvement on avoiding checking "middle" on mismatch 3. Less code but slower |
53 | Maximum Subarray | Answer | Python | 1. Dynamic Programming 2. Less code version of DP |
66 | Plus One | Answer | Python | 1. Test equal to 9 |
88 | Merge Sorted Array | Answer | Python | 1. Two Pointer 2. Optimisation for TP |
118 | Pascals Triangle | Answer | Python |
# | Title | Explanation | Code | Basic Ideas |
---|---|---|---|---|
11 | Container With Most Water | Answer | Python |
# | Title | Explanation | Code | Basic Ideas |
---|---|---|---|---|
4 | Median of Two Sorted Arrays | Answer | Python |