fspv / leetcode-anki

Anki cards generator for Leetcode
MIT License
297 stars 44 forks source link

Create cards with Solution/s on Back (in chosen langs)? #36

Closed Natedude closed 11 months ago

Natedude commented 1 year ago

I love this, but I expected it to fetch solution information/strategies and actual solution code in various languages.

Is there an easy way to edit this to get a deck with cards with the problems on the front and tons of solution info on the back? (Maybe with fields for solution/s and strategy/ies descriptions and solution lang fields like python, java, typescript, etc,. and maybe even including a field about which lang is fastest)

I am looking for a way to use Anki to memorize all the problems AND their solution/s, not just what the problems are. I feel this would be a quicker way to learn. Any ideas? Could you point me in the right direction?

fspv commented 1 year ago

Hi @Natedude.

You can add whatever you want here: https://github.com/fspv/leetcode-anki/blob/master/generate.py#L167

There are already solution and discuss URLs on the back of the card, so you're one tap away from the solution anyway. But if you want to also add code, just find somewhere to download it from and populate the card with this data.

In general, though, I don't think memoizing the solution would work. Leetcode is about problem-solving skills and the ability to recognize the pattern to approach the problem. So memoizing the code will not make you better prepared for the interview.

But as I said, if you feel like it will be useful for you, feel free to amend the card generation code a bit to include the solution from somewhere. I don't think I would like to introduce such a functionality to my repo, but definitely can't limit you in doing so locally.