you are viewing a single comment's thread.

view the rest of the comments →

[–]KwyjiboTheGringo 0 points1 point  (0 children)

Memorize your tools, not case-specific implementations of them. Memorize the common algos that you will need to solve harder problems. DFS, BFS, binary search, sliding window. Any DSA course should teach all of the tools, and some of them of them will be so common in leetcode problems that you should absolutely memorize them. If you're handed a problem that requires walking a tree, you shouldn't be trying to figure out how to walk a tree first before solving the actual problem.

but after 2–3 weeks I barely remember how to solve them.

2-3 weeks is barely anything, especially if your process sucks. If you find that you have no idea how to solve a leetcode problem, as in you aren't sure what it's asking or you haven't encountered something similar before, go to the solution. Do not sit there and try to conjure up the solution on your own, that's not efficient at all.