DSA preparation using Leetcode and Notion
Table of contents
Hi, there. If you're great at solving DSA problems and remembering the concepts and patterns long after solving such a problem, this post is not for you. If you keep forgetting the concepts and patterns used in a problem, if you have been unable to solve a question, you've previously solved, when you faced the same in a contest or interview, then keep reading.
We're going to use a well-known studying technique spaced repetition.
Prerequisites
A Leetcode account (link)
A Notion account (link)
Ensure that python3 and pip are installed in the environment.
Setup
Clone this repo: LC_Notion python branch
git clone https://github.com/Azanul/LC_Notion.git git checkout python
You'll find a file named
testenv
in the folder. Open it.We need to fill these three fields to get the script to work. Let's start with
lc_username
. Simply copy your Leetcode username and append it to the first row (afterlc_username
).Go to https://www.notion.so/my-integrations. Log in to your Notion account.
You'll be on this screen now. Click on create a new integration.
Fill out the form as shown below. You are free to put anything in the "Name" and "Logo" fields. Click on Submit.
A new integration has been created by the name you entered. Click on it. I created it with the name
Leetcode
.Click on show under secrets then click on copy (or copy it yourself, who am I to judge).
Now append the copied text in the 2nd row (after
personel_notion_token
).Go to this link (LC Spaced Repetition Template).
Click on Duplicate and choose the same Notion workspace you chose in step 7.
The template has been cloned to your Notion workspace. Now just copy the text right after notion.so/ and before? and paste it into the 3rd row of our
testenv
file (right afterpersonal_db_id
).Now rename the file
testenv
totest.env
. Now you must have your env file something like this. Finally! we're all done with the setup.
Running the script
If you're using Linux/MacOS use run.sh
and if you're on Windows use run.bat
. Simply run the file in the terminal/command prompt as instructed below.
For Linux/MacOS.
run.sh
For Windows
run.bat
Check out the template you duplicated, Last 15 questions that you solved on Leetcode have been updated.
Comment down below if you have any questions or requests.
Goodluck!
Subscribe to my newsletter
Read articles from Azanul Haque directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by