DEV Community

Cover image for Never forget your Leetcode solutions using Anki cards 🌟
Jeffrey Yu
Jeffrey Yu

Posted on • Updated on

Never forget your Leetcode solutions using Anki cards 🌟

I believe many of you like me, fall into the trap that after I solved a leetcode problem, soon forgets it and never recall it during the interview :(

Then I thought, why can't I have a tool that keeps track of my forgetting curve after I solved a problem? If you don't know about forgetting curve, it's basically how much percentage I still remember a solution as days goes by. If I review the solution after a certain period of days, I get a remembered-percentage boost.

forgetting curve

And I found Anki, which just suits for this purpose. Here's how you can set up Anki cards to never forget your Leetcode solutions again.

Download

Click here to download Anki. It supports mac, windows, linux, ios, andriod, and web browsers. You can sync Anki cards across all platforms. (And it's open sourced!)

Create Anki cards

First, click Create Deck and input your new Deck name.

Anki create deck

Click Add on the top navbar and a new card. Paste your leetcode problem, link, and description into Front. Then paste your solution into Back, which you will see after you flip the card, just like Quizlet.

Anki add card

Start practicing with your Anki cards

Click Learn besides your deck and see the cards to study or review for today. Read the problem description and have some time to think about what the solution might be.

If you want to code out your solution, click the leetcode link and write it down. It's always a good practice to recode a solution in order to remember it clearly.

Anki card front

You can set a timer on the bottom right to track how long you've spent with this problem. Once you're done, click Show Answer to see the correct solution.

Compare your thought-out solution or wrote solution with the answer. Select how difficult you think the solving process is, and Anki will prompts the card back for you to review within a certain days, based on the selected difficulty.

Anki card back

Here's how I usually examine my solving process:

  • Easy: Had a clear idea what the solution is like after reading the problem. The thought-out solution is closed to the answer.
  • Good: Took a while to think or code the solution. Received a solution similar to the answer, with a few things neglected.
  • Hard: Can't figure out a working solution until seeing the answer, or my solution is not the best way to solve the problem like the answer does.

The review period will increase after you select easy or good for a second time, third time, ... until you finally master the problem. You can change the options for a deck to customize your practice speed.

  • How many cards to learn or review in a day
  • How many days to review the cards after selecting easy, good, or hard.

Anki deck options

Hope Anki cards would be helpful for you! Happy leetcoding :)

Top comments (0)