JumpyPretzel
JumpyPretzel

DSA steps/tips: Just in case it helps guys!

I am struggling DSA solver, and I understand the pain of DSA, so frustrating. But of late, I have started to get a hang of it gradually. So I thought to jot down what steps I follow, just in case it helps someone:-

Step 1. Try for 15-30 mins, user pen-paper if some ideas are coming to mind. It really helps some time. Step 2. If stuck after 15-30 mins, take a break, and take another attempt for 10 mins. Step 3. If still not getting any idea, look at the hints given. Step 4. If that too doesn’t help, read the comments on the problem (not the solution), sometimes in comments, some folks have given step by step instructions to solve it, or some more clear hint about solution. Step 5. If reading comments too doesn’t help, then read the solution. Read and try to understand the top 3 solution and also the comments made under it. Sometime the top solution is difficult to understand, so other solutions, or comments help. Step 6. Most frustrating is, when even after reading the solution, you don’t get a clue, and frustrating because by now, you may have spent hours in the problem (with gaps of course). So then, what I do is, I copy the solution, and run it in my local IDE, with debug turned on for every key step, and I try to understand what is happening at that point. That really, really helps. Sometimes, the written words may not make much sense, but running it in IDE with debug on, and analysing the data flow, really makes things clear. Step 7. Once you understand using above step, don’t copy-paste the solution as your solution, but rather than that, now, do the same solution in your IDE, but without looking at the solution now. Look at the solution only if you get stuck at specific line while writing, or while running the code. I think this step 7 is really nice, i.e. when you understand the solution by copying and running, but then you do it yourself once again, without looking at the solution. I just solved a Hard problem using this way. Step 8. Even now, if nothing makes sense, which certainly may happen, I fear there is no other way than to move on to other problems. OR, one alternate way could be to watch the video explanation of the solution (which I don’t follow till now, not much patience with video at least as of now)

My stats: About 70 problems in LC, and most of those- about 50- are easy ones done long back.

23d ago
Talking product sense with Ridhi
9 min AI interview5 questions
Round 1 by Grapevine
GigglyBoba
GigglyBoba

How much experience and which technology stack do you work?

JumpyPretzel
JumpyPretzel

11+. Java.

GigglyBoba
GigglyBoba

Me too same yoe

JumpyPretzel
JumpyPretzel

Forgot to mention, I was referring to Leetcode website in these steps. Also, in whichever problem I get stuck and need help, after solving it, I save in a custom “ReVisit” list on the website, so that I could revise those specific problems later on in future.

Discover more
Curated from across
Software Engineers
by DizzyLlamaSwiggy

Does LeetCoders Give you FOMO

I was recently scrolling through linkedin as a regular day to find my daily dose of depression

And Suddenly I saw a profile of x Person who started his engineering in July 2023 has 500+ LC Problems solved a CI/CD pipeline set up proje...

Confessions
by BouncyPickleSoftware Developer

HELP !!!

I was in manual testing for 2 years. Left my job. Joined scaler. Cleared some mock interviews (except DSA). I am in desperate need of a job in developer role(full or backend). I need to clear DSA and ReactJS mock interview in order to be...

IT Company Discussion
by SnoozyJellybeanInfosys

How to prep for switch?

Hey

I joined infosys in oct - 2022 and now it’s been 1.8 months. My tech stack is MEAN stack but I was on bench through the year, recently got into a project but for only 4 months. I developed and learned by my own and gained a better ...

Software Engineers
by GigglyHamsterStudent

To folks who can solve LC Hards

What did it take to get to that point? I'm reasonably comfortable with mediums but hard problems feel like a few notches above in difficulty. Should I find the equivalent rating of mediums on codeforces and work from there? Or is it bett...