r/learnprogramming • u/FinancialTrack5007 • 7h ago
What to do !
I know how to write code, but not in the LeetCode style . I also want to do DSA, and my seniors told me to learn a coding language too i know (I already know C, python ). Tell me what all I should do in this situation first .
5
Upvotes
4
u/JohnsTech_dev 6h ago
you dont need another language for dsa, python is fine for leetcode and most interviewers are ok with it. C is painful for it tbh, no hashmap out of the box.
what worked for me was doing problems by topic instead of random ones. like 15 easy array/hashmap problems, then two pointers, then sliding window. if stuck more than 30 min read the solution, close it, and write it again from memory next day
1
u/moonfable42 6h ago
First relearn basic DSA concepts like arrays, strings, recursion, then move to leetcode easy problems in python. Once you get comfortable move to mediums. Do like 1-2 problems a day consistently instead of binge solving. After a month or two start timing yourself like a real interview.
1
u/a3th3rus 6h ago
Try automating some of your simple but repetitive works. If you don't have one, see if your friends have any that you can help with. For example, my wife (a translator) always have the need for extracting text that needs to be translated from a certain format of XML, and I wrote a Ruby script for that, and another for stuffing the translated text back to that XML.
Also, if you play video games, you can write some algorithm for yourself to minmax something. For example, I've written something that finds the optimal fights in Valkyrie Profile to gain as much exp as possible with no member levels up.
1
u/Perfect-Schedule-546 1h ago
don't add a third language. DSA is the same in C and Python, and learning a new
one now just makes you slow at typing while you're already learning the real
skill.
pick python since you know it, spend a month on arrays/hashmaps/two pointers
before you touch trees, and do 2-3 problems a day instead of 20 in one night.
leetcode style is pattern recognition, not coding ability. it feels different
from your normal code because it is a different skill you train it, you're
not missing it.