My Leetcode Journey with some tips

I have started my leetcode journey after 2 years of my college and I get this feeling that I should have started early in my college days but it's never too late. I have almost 3.5 year of experience mostly in Data Analytics. I hope you’ll read it till the end.

I have been consistently coding everyday from last year May to till date without missing a day but there are many days I struggled when I get to start with new concepts mainly DP, Graphs and Binary Search. I want to share my experience and help others to build their confidence
By now I’ve solved almost 1000 different questions - 1003 if to be precise. 303 - easy, 568 - medium, 132 - hard. Now let’s take a look at my submission history. Below are some of my achievements in 2021

🔥2021 Achievements :
Solved 1000+ problems and 2000+ submissions in leetcode.
Solved around 200 problems from other Competative coding platforms
Did all Monthly challanges in 2020 and 2021. in Leetcode
14 badges (+1 Lost my Knight badge in last contest)
Maintaining coding Streak of 609 days.
Able to solve all 4 in Contests (In most contests I was able to do 3 in a contest) in Leetcode contests.
Increased my contest rating from 1500 to 1870 (Current: 1818) in Leetcode
Became flexible in solving Graph and DP problems
Best Contest rank achieved 554 in contest.
Also received the Annual Badge from Leetcode
Got Job offers from Microsoft, Swiggy ands 3 other offers.

My Profile:
image
image
image

All tips and things I followed to get here:

Struggles I faced and things I followed to overcome them:

  1. In the initial days it has been very hard to set my mindset to code everyday.
    Solved the very easy problems and the problems I'm sure I will solve.

  2. Faced TLE for medium-hard problems.
    Along with problem statement, I concentrated on constraints of problem and extracted time and space complexity then started thinking about solution.

  3. Used to face Wrong Answers more frequent due to unable to think of corner cases and in a hurry to solve the problem.
    Started spending 3-5 min on the question first instead of looking the example testcase first and took next 10 min to come up with a solution
    and do dry run on paper and then code the solution on paper.

  4. There are times I feel just not to code.
    I used to code 2-3 easy problems which gets me away from feeling of not to code.

  5. When you are feeling discouraged or continuously failing to solve problems
    I use the hints if available or I extract hints from Discussion section of problem and check 4-5 approaches of others in discussions. This helped me in long run.

Tips for Contests:

  1. Bad time management ->
    I started using 1:30 hr as following
    Q1, Q2 -> Spending 30 min
    Q3 -> 25-30 min (up to 45 min)
    Q4 -> Time left depending upon Q1, Q2,Q3
    but most of the time for Q4 I just read the question and try to understand the question better and then think about brute force solution and after the contest, I check other's solutions.

-> Do virtual contests also not only live contests.

  1. Multiple WA and Bug fixes -> Build logic on paper and write down rough pseudo-code, (Depending on time also work out with sample test cases + think base test cases)

  2. Not checking on constraints -> After having a better understanding of the problem, go to constraints and think whether O(2^n) or O(N^3) or O(N^2) or O(NLogN) or O(N) solution is required for getting accepted.

PS: From an interview point of view you might need to come up with an optimal solution even for a problem with small constraints.
In terms of the contest, I would suggest coming up with a solution that is accepted by the online judge and then work out an optimal solution for it after the contest.

->If you are not upsolving the problems after the contest then at least have a look at the other approaches/solutions.

Other Tips:

  1. Believed in completing a task every day for 21 days in row -> Believe me it works.

  2. Start with solving easy problems initially -> This helped me alot

  3. If you are getting distracted frequently listen to music while coding -> This might not work for everyone but give it a try.

  4. Practice on paper -> write down code on paper and do a dry with testcases. it will make more familiarize with language syntax and more confident and less distractions while coding solution on IDE.

  5. Try to observe code patterns -> This takes time to get habituated

  6. Be consistent

All the best to everyone and hope my experience helps you to get started or get unblocked.

Comments (10)