this repo records my pratice of leetcode questions.
This project contains a make file script written in python that helps to download and create local file directly from leetcode.com
The python script requires is run on python3, and require pypi and selenium chrome driver used for automatically download question and description from the website.
python3 --version
pip3 --version
Pip
for Mac OS
brew install python3
pip3 --version
Or Ubuntu 18.04
sudo apt update
sudo apt install python3-pip
pip3 --version
beatifulSoup
sudo apt-get install python3-bs4
or
pip3 install bs4
Selenium
pip3 install selenium
Web Drivers
Selenium requires a driver to interface with the chosen browser. Firefox, for example, requires geckodriver, which needs to be installed before the below examples can be run. Make sure it’s in your PATH, e. g., place it in /usr/bin or /usr/local/bin.
https://sites.google.com/a/chromium.org/chromedriver/downloads
python3 make.py "question_url"
python3 make.py "question number"
- Provide option for entering question number or question url
- Seperate project
In the first round of going through the questions, i did on about 200 questions randomly. For the second round, i am planning to solving the problem by topics.
- Array
- Strings
- Linked List
- Trees
- Sorting and Searching
- Dynamic Programming
- Design
- Math
- Others
Array | Questions | Methods | Complexity |
---|---|---|---|
X | Remove Duplicates from Sorted Array | Two Pointers | Time: O(n); Space: O(1) |