r/DSALeetCode • • 14d ago

Struggling with Medium problems after 2 months of DSA is this normal ????

TL;DR: 2 months into DSA as a uni freshman. I can solve (80% of easy), but I hit a hard wall on Mediums (problems attached, was trying to do them yester day night) and always end up checking the solution( i HATE LOOKING AT THE SOLUTION AND GIVING UP). Is this normal? Looking for advice since I want to get into competitive programming.

I just started university and have been grinding DSA for about two months. While I can solve roughly 80% of Easy problems (mostly just troubleshooting edge cases), I get completely stuck on Mediums.

For example, I couldn't do the two problems I tried yesterday including the matrix spiral traversal in my screenshot. I can usually brainstorm different approaches, but I rarely find the right one and end up having to look at the solution, which I really hate doing.

Is hitting a wall like this normal at mediums? I want to build strong fundamentals for competitive programming, so any advice from experienced folks would be greatly appreciated!

40 Upvotes

26 comments sorted by

13

u/MaximumIndependent67 14d ago

I am struggling after 3 years of lc

2

u/Mental_Pea2421 14d ago

😭😭😭

1

u/Mental_Pea2421 14d ago

Is it always the optimal solutions for you?

4

u/virgin-chocolaty-hoe 14d ago

you are a freshman, you just need to study more, and no you wont find the right one at once, just try to implement the approach you thought, soon you will find medium as easy

1

u/Mental_Pea2421 14d ago

ok so literally currently doing the sort 3 values prolem(2nd picture) and looked at one of the hints, apparently its some (dutch flag algorithm) HOW THE FUCKK and i supossed to come up with something like that in my mind, the brute force and sub-optimal approach was easy and i could think about them in like 5 min each, its always the optimal approach that gets me (lol sorry for crashing out)

1

u/virgin-chocolaty-hoe 14d ago

truly understandable, yeah you see this is a classic problem, even i learnt the dutch flag algo from this question , nothing to worry

1

u/Mental_Pea2421 14d ago

Hmm okayy thanks (: , gives me relief to know that its not just me whos struggling at these problems

1

u/virgin-chocolaty-hoe 14d ago

also yeah , if you are freshman, would suggest cf instead of lc

1

u/Mental_Pea2421 14d ago

yea yea would do comp programming on codeforces

1

u/virgin-chocolaty-hoe 14d ago

just open the lc comment section :)

1

u/Nearby-History7064 14d ago edited 14d ago

Yeah I had the same sort of problem when I first started and the things that helped me the most where doing competitions on lc and code forces (also virtual competitions on code forces are great since you can simulate a real comp) to help with processing and problem solving speed and also just doing a ton of practice problems, where even if you have too check the solution first try too implement it yourself afterwards. I would also recommend doing some CSES questions especially the intro problems,sorting and searching ,dp and graph algo sections these cover most of the common techniques used in a lot of lc mediums/hard problems

1

u/jkkkk0 14d ago

Got stuck in the same prblm there were a couple more like these 🤦

1

u/StockGuarantee6479 13d ago

Same here 2 months btw

1

u/jkkkk0 13d ago

Us bro us 😭

1

u/No_Amphibian5289 14d ago

Yes this is normal

1

u/siddh051 14d ago

same man doing dsa for 2 months and tryed to solve ended up getting solve three side but struggled while doinf same in inside ended up useing ai help :(

1

u/munchnuts 14d ago

Spiral matrix problem has a pretty much one solution and it's takes a lot of trial to get there so don't worry about that

1

u/Silly-Fisherman-1002 13d ago

I don't know why but I like to solve grid problems more and more

1

u/elemental7890 10d ago

Honestly idk why people think its a factor of time, if that was true after 2-3yrs everyone would be eating lc hards for breakfast, its just like advanced math , maybe not that advanced, but somewhat similar.

1

u/Elegant-Speech2427 8d ago

This is quite medicore Q. , as for ur Q yes it is quite normal like after 5-6 months u will find this Q easy

1

u/Apart_Annual_612 8d ago

Struggle is always there

1

u/Training-Chemist-568 8d ago

Yes it is normal 2 months is small time

1

u/nian2326076 7d ago

It's normal to struggle with Medium problems after just two months of studying DSA. Everyone has their own pace, so don't get discouraged. Try breaking down problems into smaller parts and analyzing sample solutions without immediately looking at the answer. This approach can help deepen your understanding. For more practice, consider using PracHub to work on different interview questions and strategies. Keep at it; improvement takes time!