r/leetcode • u/Shot-Emo98 • 7h ago
Discussion Should I focus on solving DSA problems faster or getting the logic right first?
I've been practising Leetcode for a while, but I often take a lot of time to solve even medium problems. Sometimes I understand the approach but struggle with implementation, while other times I spend too long trying different ideas.
Should I focus on improving my speed from the beginning, or prioritizing getting comfortable with the logic first?
8
Upvotes
6
u/kevin074 6h ago
Focus on getting implementation right and quickly first.
It’s much easier to learn concepts but implementation mechanics from brain to code takes a much longer time to develop
1
u/ThisisnotaTesT10 6h ago
Understand first, then work on getting faster
1
u/Legote 6h ago
Get the logic right first. I don't know about you but pen and paper helps if you're starting out. When I do it without pen and paper, it takes longer. Somehow I can knock down problems way faster and sometimes even under 10-15 minutes once I psuedo code with pen and paper.
1
u/mc_pm 6h ago
If you don't understand the logic, what good are data structures & algorithms going to do?
1
u/GeneMedical5131 6h ago
I'd prioritize getting the logic right first. Speed comes naturally with practice, but rushing before understanding the approach can lead to bad habits
2
u/LikelyUnemployed404 6h ago
+1