Master Leetcode Contests — 3 Tips

Kanav Arora
Competitive Programming
3 min readMay 3, 2023

--

Photo by Fotos on Unsplash

Recently I have been taking some sessions on road to mastering Data Structures and Algorithms, and Competitive Programming. Leetcode contests are perfect for those who want grip on their DSA concepts and want to experience competitive pressure. Now you might be thinking “Do we really need to read this article and who’s this person?”. So if I tell you I have been coding properly for like past 6–7 months only. I started Leetcode contests probably in like september last year. Since then I have given almost all the contests and It took me just 15 contests to get into top 3% Leetcoders. You can do the same with a little bit dedication and motivation. Just keep these points in the mind:

Don’t Miss Contests

No matter you are busy with your exams or day to day work. You must take out some time to give the contest. Leetcode Biweekly contests are held alternating Saturdays at 8pm IST and Weekly contests are held every Sunday 8am IST. If by any chance you missed any contest, attempt virtual contest. Virtual contests gives you an idea of what your ranking would be but It will not change your rating.

Upsolve problems

Generally people participate and then post contest they don’t try to solve unsolved problems or try to find a more optimized approach for the problem they have solved. Note this if you’ll not upsolve you can’t learn anything from the contest.

Those who don’t learn from their mistakes are bound to repeat them.

Like if you have solved A and B question. Then give one day to review the solutions you have solved and one day to solve C and D question.

Topics to Cover

Contests on platforms like Leetcode, GeeksForGeeks(GFG) and CodeStudio are more based on DSA and not on competitive concepts. So for these contests you should have a good grip on below mentioned topics:

  • Arrays
  • Linked Lists
  • Stack/Queue/Priority Queue
  • Trees : Traversal questions and DFS approach are important
  • Graphs : Graph algorithms like Dijkstra, Floyd Warshall are important.
  • Greedy Algorithm
  • Dynamic Programming
  • Union Find
  • Two Pointer Approach
  • Sliding Window

Hold on Trees, Graphs and Dynamic Programming takes time. These are a bit lengthy topics and need more practice. Refer https://github.com/Kanav-Arora/DSA-Cpp repository for topic-wise codes to various problems and concepts.

P.S: First try to solve the problem on your own.

Don’t Directly Jump to Solution

This is one the most important point. Directly jumping to the solution makes you handicap and will not improve your problem approachability. First give it a thought and try to dry run your solutions on given testcases. Solve it on a paper and then submit it. Then only you should consider looking the solution. Now most common mistake people make is they prefer text solutions over video solutions but text solutions can’t have that much of understanding. You need to get the intuition of the problem so that you can solve it again on your own.

Believe me or not, Leetcode problems are same or somewhat similar to the interview problems. So you must solve these if you are appearing for a tech interview.

Thanks for reading! If you like the article please give it a clap👏 and follow the publication for more such stories. Follow me on LinkedIn.

--

--